From b50083a7f021cba2a1815255848fb035e85c7c55 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Sat, 25 Dec 2021 14:20:35 +0200 Subject: [PATCH 1/4] CI: {caching,test,bench}: paths layout --- .github/workflows/bench.yml | 13 ++++++++++++- .github/workflows/caching.yml | 11 ++++++++++- .github/workflows/test.yml | 20 ++++++++++++++++++-- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index c93758c823..cf713e2f1c 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -24,7 +24,18 @@ jobs: uses: fkirc/skip-duplicate-actions@v3.4.1 with: cancel_others: false - paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "**.nix", "**/test/**", "flake.lock", "**/README.md", "FUNDING.yml", "**/stack*.yaml"]' + paths_ignore: '[ "**/docs/**" + , "**.md" + , "**/LICENSE" + , ".circleci/**" + , "install/**" + , "**.nix" + , "**/test/**" + , "flake.lock" + , "**/README.md" + , "FUNDING.yml" + , "**/stack*.yaml" + ]' bench_init: if: needs.pre_job.outputs.should_skip != 'true' diff --git a/.github/workflows/caching.yml b/.github/workflows/caching.yml index a1a6c8a5b9..8cc656aeb9 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -58,7 +58,16 @@ jobs: uses: fkirc/skip-duplicate-actions@v3.4.1 with: cancel_others: false - paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", "install/**", "**.nix", "flake.lock", "**/README.md", "FUNDING.yml", ".circleci/**"]' + paths_ignore: '["**/docs/**" + , "**.md" + , "**/LICENSE" + , "install/**" + , "**.nix" + , "flake.lock" + , "**/README.md" + , "FUNDING.yml" + , ".circleci/**" + ]' caching: if: needs.pre_job.outputs.should_skip != 'true' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3dafcdf2dd..12babc2226 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,13 +25,29 @@ jobs: uses: fkirc/skip-duplicate-actions@v3.4.1 with: cancel_others: false - paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", "install/**", "**.nix", "flake.lock", "**/README.md", "FUNDING.yml", ".circleci/**", "**/stack*.yaml"]' + paths_ignore: '[ "**/docs/**" + , "**.md" + , "**/LICENSE" + , "install/**" + , "**.nix" + , "flake.lock" + , "**/README.md" + , "FUNDING.yml" + , ".circleci/**" + , "**/stack*.yaml" + ]' # If we only change ghcide downstream packages we have not test ghcide itself - id: skip_ghcide_check uses: fkirc/skip-duplicate-actions@v3.4.1 with: cancel_others: false - paths_ignore: '["hls-test-utils/**", "plugins/**", "src/**", "exe/**", "test/**", "shake-bench/**"]' + paths_ignore: '[ "hls-test-utils/**" + , "plugins/**" + , "src/**" + , "exe/**" + , "test/**" + , "shake-bench/**" + ]' test: if: needs.pre_job.outputs.should_skip != 'true' From 5245f31a7dff3526359ee989a6ca5ac8ed7d5729 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Sat, 25 Dec 2021 14:24:47 +0200 Subject: [PATCH 2/4] CI: nix: paths layout --- .github/workflows/nix.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index ee3d544949..bc2b9bed6c 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -24,12 +24,20 @@ jobs: uses: fkirc/skip-duplicate-actions@v3.4.1 with: cancel_others: false - paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "**/README.md", "FUNDING.yml", "**/stack*.yaml"]' + paths_ignore: '[ "**/docs/**" + , "**.md" + , "**/LICENSE" + , ".circleci/**" + , "install/**" + , "**/README.md" + , "FUNDING.yml" + , "**/stack*.yaml" + ]' - id: skip_check_no_nix uses: fkirc/skip-duplicate-actions@v3.4.1 with: cancel_others: false - paths: '["**.nix"]' + paths: '[ "**.nix" ]' # Enter the development shell and run `cabal build` develop: From ca9add347bda566c6bc49b6c987ead7941f3bab6 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Sat, 25 Dec 2021 15:28:55 +0200 Subject: [PATCH 3/4] CI: build: organize step names --- .github/workflows/build.yml | 46 ++++++++++++++++++++++------------- .github/workflows/caching.yml | 12 +++++++-- .github/workflows/test.yml | 9 +++++-- 3 files changed, 46 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bea52c56a5..ca67b53dc4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,8 +18,17 @@ jobs: strategy: fail-fast: false matrix: - ghc: ['9.0.1', '8.10.7', '8.10.6', '8.8.4', '8.6.5'] - os: [ubuntu-18.04, macOS-latest, windows-latest] + ghc: + [ "9.0.1" + , '8.10.7' + , "8.10.6" + , "8.8.4" + , "8.6.5" + ] + os: [ "ubuntu-18.04" + , "macOS-latest" + , "windows-latest" + ] cabal: ['3.6'] steps: @@ -44,7 +53,7 @@ jobs: echo -e 'package blaze-textual\n flags: +integer-simple' >> cabal.project.local fi - - name: Use modified cabal.project for ghc9 + - name: (GHC 9.0) Use modified cabal.project for GHC 9.0 if: ${{ matrix.ghc == '9.0.1' }} run: cp cabal-ghc901.project cabal.project @@ -56,7 +65,7 @@ jobs: sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \ src/**/*.hs exe/*.hs - - name: Set some window specific things + - name: (Windows) Platform specifics if: matrix.os == 'windows-latest' env: GHC_VER: ${{ matrix.ghc }} @@ -64,7 +73,7 @@ jobs: echo "EXE_EXT=.exe" >> $GITHUB_ENV echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV - - name: Set some linux specific things + - name: (Linux) Platform specifics if: matrix.os == 'ubuntu-18.04' env: GHC_VER: ${{ matrix.ghc }} @@ -72,20 +81,20 @@ jobs: echo "LINUX_CABAL_ARGS=--enable-executable-static --ghc-options=-split-sections" >> $GITHUB_ENV echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV - - name: Set some macOs specific things + - name: (macOS) Platform specifics if: matrix.os == 'macOS-latest' env: GHC_VER: ${{ matrix.ghc }} run: | echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV - - name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows + - name: (Windows, GHC 8.8.4) Workaround segfaults if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest' run: | echo "package floskell" >> cabal.project echo " ghc-options: -O0" >> cabal.project - - name: Build server + - name: Build the server # Try building it twice in case of flakey builds on Windows run: | cabal build --disable-tests exe:hls -O2 $LINUX_CABAL_ARGS || \ @@ -109,7 +118,7 @@ jobs: echo ::set-output name=extension::gz fi - - name: Upload server to release + - name: (not check) Upload server to release if: ${{ !contains(github.ref_name, 'check') }} uses: actions/upload-release-asset@v1.0.2 env: @@ -126,11 +135,11 @@ jobs: name: haskell-language-server-${{ runner.OS }}-${{ matrix.ghc }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }} path: ${{ steps.compress_server_binary.outputs.path }} - - name: Build wrapper + - name: (GHC 8.10) Build the wrapper if: matrix.ghc == '8.10.7' run: cabal build --disable-tests exe:hls-wrapper -O2 $LINUX_CABAL_ARGS - - name: Compress wrapper binary + - name: (GHC 8.10) Compress wrapper binary if: matrix.ghc == '8.10.7' id: compress_wrapper_binary run: | @@ -149,7 +158,7 @@ jobs: echo ::set-output name=extension::gz fi - - name: Upload wrapper to the release + - name: (GHC 8.10, not check) Upload wrapper to the release if: ${{ matrix.ghc == '8.10.7' && !contains(github.ref_name, 'check') }} uses: actions/upload-release-asset@v1.0.2 env: @@ -160,7 +169,7 @@ jobs: asset_name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }} asset_content_type: ${{ steps.compress_wrapper_binary.outputs.content_type}} - - name: Upload wrapper to workflow artifacts + - name: (GHC 8.10) Upload wrapper to workflow artifacts uses: actions/upload-artifact@v2 if: matrix.ghc == '8.10.7' with: @@ -183,7 +192,7 @@ jobs: -o src-dist/haskell-language-server.tar.gz \ HEAD - - name: Upload source tarball to the release + - name: (not check) Upload source tarball to the release if: ${{ !contains(github.ref_name, 'check') }} uses: actions/upload-release-asset@v1.0.2 env: @@ -207,7 +216,10 @@ jobs: runs-on: ubuntu-18.04 strategy: matrix: - os: [Linux, macOS, Windows] + os: [ "Linux" + , "macOS" + , "Windows" + ] steps: - uses: actions/download-artifact@v2 @@ -227,7 +239,7 @@ jobs: fi tar -czpf haskell-language-server.tar.gz * - - name: Upload binaries tarball to the release + - name: (not check) Upload binaries tarball to the release if: ${{ !contains(github.ref_name, 'check') }} uses: actions/upload-release-asset@v1.0.2 env: @@ -256,7 +268,7 @@ jobs: # we clean up tags to match the release file names sed -i 's/\/.*)/)/g' SHA256SUMS - - name: Upload sha256sums to the release + - name: (not check) Upload sha256sums to the release if: ${{ !contains(github.ref_name, 'check') }} uses: actions/upload-release-asset@v1.0.2 env: diff --git a/.github/workflows/caching.yml b/.github/workflows/caching.yml index 8cc656aeb9..66ab4cd876 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -76,8 +76,16 @@ jobs: strategy: fail-fast: false matrix: - ghc: ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.6.5"] - os: [ubuntu-latest, macOS-latest, windows-latest] + ghc: [ "9.0.1" + , "8.10.7" + , "8.10.6" + , "8.8.4" + , "8.6.5" + ] + os: [ "ubuntu-latest" + , "macOS-latest" + , "windows-latest" + ] cabal: ['3.6'] steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 12babc2226..1d7c1d27e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,7 +56,12 @@ jobs: strategy: fail-fast: true matrix: - ghc: ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.6.5"] + ghc: [ "9.0.1" + , "8.10.7" + , "8.10.6" + , "8.8.4" + , "8.6.5" + ] os: [ubuntu-latest, macOS-latest] cabal: ['3.6'] include: @@ -109,7 +114,7 @@ jobs: # Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file - if: matrix.ghc == '9.0.1' - name: (GHC 9.0.1) Use modified `cabal.project` + name: (GHC 9.0) Use modified `cabal.project` run: | # File has some protections preventing regular `rm`. # (most probably sticky bit is set on $HOME) From a004f31848f024d961f1c1300033ce54bbaa708e Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Sun, 26 Dec 2021 00:34:59 +0200 Subject: [PATCH 4/4] CI: build: organize step names --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4318d9f562..f16d1c1f2e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,7 +62,9 @@ jobs: , "8.8.4" , "8.6.5" ] - os: [ubuntu-latest, macOS-latest] + os: [ "ubuntu-latest" + , "macOS-latest" + ] cabal: ['3.6'] include: # only test supported ghc major versions