diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index ef6e44885e..efd00bb858 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -1,10 +1,5 @@ name: Benchmark -# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. -concurrency: - group: ${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true - on: pull_request: branches: @@ -31,6 +26,7 @@ jobs: fail-fast: false matrix: ghc: ['8.10.7'] + cabal: ["3.6"] os: [ubuntu-latest] steps: @@ -39,24 +35,57 @@ jobs: - run: git fetch origin master # check the master branch for benchmarking - uses: haskell/actions/setup@v1 + id: HaskEnvSetup with: ghc-version: ${{ matrix.ghc }} - cabal-version: '3.2' + cabal-version: ${{ matrix.cabal }} enable-stack: false - - name: Cache Cabal + - if: ( runner.os == 'Linux' ) || ( runner.os == 'macOS' ) + name: (Linux,macOS) Platform config + run: | + echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV + + # 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` + run: cp cabal-ghc901.project cabal.project + + - name: Retrieving `cabal.project` Hackage timestamp + run: | + # Form: index-state: 2021-11-29T08:11:08Z + INDEX_STATE_ENTRY=$(grep index-state cabal.project) + # Form: 2021-11-29T08-11-08Z + INDEX_STATE1=$(echo "$INDEX_STATE_ENTRY" | cut -d' ' -f2 | tr ':' '-') + echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV + + # 2021-12-02: NOTE: Cabal Hackage source tree storage does not depend on OS or GHC really, + # but can depend on `base`. + # But this caching is happens only inside `master` for `master` purposes of compiling the deps + # so having a shared pool here that depends only on Hackage pin & does not depend on `base` is "good enough" + # & used such because it preserves 10% of a global cache storage pool. + - name: Hackage sources cache uses: actions/cache@v2 + env: + cache-name: hackage-sources with: - path: | - ~/.cabal/packages - ~/.cabal/store - key: v2-${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }} + path: ${{ env.CABAL_PKGS_DIR }} + key: ${{ env.cache-name }}-${{ env.INDEX_STATE }} + restore-keys: ${{ env.cache-name }}- + + - name: Compiled deps cache + uses: actions/cache@v2 + env: + cache-name: compiled-deps + with: + path: ${{ steps.HaskEnvSetup.outputs.cabal-store }} + key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project') }} restore-keys: | - v2-${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }} - v2-${{ runner.os }}-${{ matrix.ghc }}-bench- - v2-${{ runner.os }}-${{ matrix.ghc }} + ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}- + ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- + ${{ env.cache-name }}-${{ runner.os }}- - - run: cabal update + - run: cabal v2-update # max-backjumps is increased as a temporary solution # for dependency resolution failure diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3d9d6824a..e5098384e8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,8 @@ jobs: strategy: fail-fast: false matrix: - ghc: ['9.0.1', '8.10.7', '8.10.6', '8.10.5', '8.8.4', '8.8.3', '8.6.5'] + ghc: ['9.0.1', '8.10.7', '8.10.6', '8.8.4', '8.8.3', '8.6.5'] + cabal: ["3.6"] os: [ubuntu-18.04, macOS-latest, windows-latest] exclude: - os: windows-latest @@ -31,7 +32,7 @@ jobs: - uses: haskell/actions/setup@v1 with: ghc-version: ${{ matrix.ghc }} - cabal-version: '3.4' + cabal-version: ${{ matrix.cabal }} - name: Use modified cabal.project for ghc9 if: ${{ matrix.ghc == '9.0.1' }} @@ -68,12 +69,6 @@ jobs: run: | echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV - - name: Workaround for GHC 8.10.5 on macOS - if: matrix.os == 'macOS-latest' && matrix.ghc == '8.10.5' - run: | - echo "# uninstalling CommandLineTools (see https://github.com/haskell/haskell-language-server/issues/1913#issuecomment-861667786)" - sudo rm -rf /Library/Developer/CommandLineTools - - name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest' run: | diff --git a/.github/workflows/cache-deps.yml b/.github/workflows/cache-deps.yml deleted file mode 100644 index 98935839c9..0000000000 --- a/.github/workflows/cache-deps.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: Caching of dependencies - -# 2021-11-30: NOTE: This workflow currently a trimmed copy of a main `test.yml` workflow. Workflows need further deduplication: https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#overview - -defaults: - run: - shell: bash - -# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. -concurrency: - group: ${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true - -on: - push: - branches: - - master - schedule: - # Try to save snapshot every day at 08:25 UTC (~00:25 in California) - - cron: "25 8 * * *" - -jobs: - pre_job: - runs-on: ubuntu-latest - outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} - should_skip_ghcide: ${{ steps.skip_ghcide_check.outputs.should_skip }} - steps: - - id: skip_check - 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/**"]' - # 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/**"]' - - deps: - if: needs.pre_job.outputs.should_skip != 'true' - needs: pre_job - runs-on: ${{ matrix.os }} - strategy: - matrix: - ghc: ["9.0.1", '8.10.7', '8.10.6', "8.10.5", "8.8.4", "8.8.3", "8.6.5"] - os: [ubuntu-latest, macOS-latest, windows-latest] - exclude: - - os: windows-latest - ghc: '8.8.3' - - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - uses: haskell/actions/setup@v1 - with: - ghc-version: ${{ matrix.ghc }} - cabal-version: "3.4" - - - if: matrix.os == 'windows-latest' - name: Set some window specific things - run: | - echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV - echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV - - - if: matrix.os != 'windows-latest' - name: Set some linux/macOS specific things - run: | - echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV - echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV - - - if: matrix.os == 'macOS-latest' && matrix.ghc == '8.10.5' - name: Workaround for GHC 8.10.5 on macOS - run: | - echo "# uninstalling CommandLineTools (see https://github.com/haskell/haskell-language-server/issues/1913#issuecomment-861667786)" - sudo rm -rf /Library/Developer/CommandLineTools - - # 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: Use modified cabal.project for ghc9 - run: cp cabal-ghc901.project cabal.project - - - if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest' - name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows - run: | - echo "package floskell" >> cabal.project - echo " ghc-options: -O0" >> cabal.project - - - name: Cache Cabal - uses: actions/cache@v2 - env: - cache-name: cache-cabal - with: - path: | - ${{ env.CABAL_PKGS_DIR }} - ${{ env.CABAL_STORE_DIR }} - key: v2-${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }} - restore-keys: | - v2-${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }} - v2-${{ runner.os }}-${{ matrix.ghc }}-build- - v2-${{ runner.os }}-${{ matrix.ghc }} - - - run: cabal update - - # Need this to work around filepath length limits in Windows - - name: Shorten binary names - run: | - sed -i.bak -e 's/haskell-language-server/hls/g' \ - -e 's/haskell_language_server/hls/g' \ - haskell-language-server.cabal cabal.project - sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \ - src/**/*.hs exe/*.hs - - # repeating builds to workaround segfaults in windows and ghc-8.8.4 - - name: Build - run: cabal build --only-dependencies || cabal build --only-dependencies || cabal build --only-dependencies diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml new file mode 100644 index 0000000000..8d0d003d48 --- /dev/null +++ b/.github/workflows/cache.yml @@ -0,0 +1,129 @@ +name: Caching + +# 2021-11-30: NOTE: This workflow currently a trimmed copy of a main `test.yml` workflow. Workflows need further deduplication: https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#overview + +defaults: + run: + shell: bash + +on: + push: + branches: + - master + pull_request: + branches: + - '**' + +env: + cabalBuild: "v2-build all --enable-tests --enable-benchmarks" + +jobs: + + caches: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + ghc: ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.8.3", "8.6.5"] + cabal: ["3.6"] + os: [ubuntu-latest, macOS-latest, windows-latest] + exclude: + - os: windows-latest + ghc: '8.8.3' + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - uses: haskell/actions/setup@v1 + id: HaskEnvSetup + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: ${{ matrix.cabal }} + + - if: runner.os == 'Windows' + name: (Windows) Platform config + run: | + echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV + + - if: ( runner.os == 'Linux' ) || ( runner.os == 'macOS' ) + name: (Linux,macOS) Platform config + run: | + echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV + + # 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` + run: | + cp cabal-ghc901.project cabal.project + + - if: runner.os == 'Windows' && matrix.ghc == '8.8.4' + name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults + run: | + echo "package floskell" >> cabal.project + echo " ghc-options: -O0" >> cabal.project + + # Work around for filepath length limits in Windows + - name: (Windows) Shorten binary names + run: | + sed -i.bak -e 's/haskell-language-server/hls/g' \ + -e 's/haskell_language_server/hls/g' \ + haskell-language-server.cabal cabal.project + sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \ + src/**/*.hs exe/*.hs + + - name: Retrieving `cabal.project` Hackage timestamp + run: | + # Form: index-state: 2021-11-29T08:11:08Z + INDEX_STATE_ENTRY=$(grep index-state cabal.project) + # Form: 2021-11-29T08-11-08Z + INDEX_STATE1=$(echo "$INDEX_STATE_ENTRY" | cut -d' ' -f2 | tr ':' '-') + echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV + + # 2021-12-02: NOTE: Cabal Hackage source tree storage does not depend on OS or GHC really, + # but can depend on `base`. + # But this caching is happens only inside `master` for `master` purposes of compiling the deps + # so having a shared pool here that depends only on Hackage pin & does not depend on `base` is "good enough" + # & used such because it preserves 10% of a global cache storage pool. + - name: Hackage sources cache + uses: actions/cache@v2 + env: + cache-name: hackage-sources + with: + path: ${{ env.CABAL_PKGS_DIR }} + key: ${{ env.cache-name }}-${{ env.INDEX_STATE }} + restore-keys: ${{ env.cache-name }}- + + - name: Compiled deps cache + uses: actions/cache@v2 + env: + cache-name: compiled-deps + with: + path: ${{ steps.HaskEnvSetup.outputs.cabal-store }} + key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project') }} + restore-keys: | + ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}- + ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- + ${{ env.cache-name }}-${{ runner.os }}- + + - run: cabal v2-update + + - name: Download all sources + run: | + cabal $cabalBuild --only-download + + - if: runner.os != 'Windows' + name: (Default) Build all targets + # If some builds not passed, atill cache what is available. + continue-on-error: true + run: | + cabal $cabalBuild + + # repeating builds to workaround segfaults in windows and ghc-8.8.4 + # separate build steps for platforms are needed because if Windows build aborts once - it returns the error code but despite how it is on other platforms - repeated compilation may succeed. + - if: runner.os == 'Windows' + name: (Windows) Build all targets; Restart build 3 times + continue-on-error: true + run: | + cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index a5c143dd78..d84c31e8f1 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -1,10 +1,5 @@ name: Hackage -# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. -concurrency: - group: ${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true - on: push: branches: @@ -33,6 +28,7 @@ jobs: "8.10.7", "8.8.4", "8.6.5"] + cabal: ["3.6"] exclude: - ghc: "9.0.1" package: "hls-brittany-plugin" @@ -52,21 +48,55 @@ jobs: - uses: haskell/actions/setup@v1 with: ghc-version: ${{ matrix.ghc }} - cabal-version: '3.4' + cabal-version: ${{ matrix.cabal }} + + - name: Retrieving `cabal.project` Hackage timestamp + run: | + # Form: index-state: 2021-11-29T08:11:08Z + INDEX_STATE_ENTRY=$(grep index-state cabal.project) + # Form: 2021-11-29T08-11-08Z + INDEX_STATE1=$(echo "$INDEX_STATE_ENTRY" | cut -d' ' -f2 | tr ':' '-') + echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV + + # 2021-12-02: NOTE: Cabal Hackage source tree storage does not depend on OS or GHC really, + # but can depend on `base`. + # But this caching is happens only inside `master` for `master` purposes of compiling the deps + # so having a shared pool here that depends only on Hackage pin & does not depend on `base` is "good enough" + # & used such because it preserves 10% of a global cache storage pool. + - name: Hackage sources cache + uses: actions/cache@v2 + env: + cache-name: hackage-sources + with: + path: ${{ env.CABAL_PKGS_DIR }} + key: ${{ env.cache-name }}-${{ env.INDEX_STATE }} + restore-keys: ${{ env.cache-name }}- + + - run: cabal v2-update + + - name: Compiled deps cache + uses: actions/cache@v2 + env: + cache-name: compiled-deps + with: + path: ${{ steps.HaskEnvSetup.outputs.cabal-store }} + key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project') }} + restore-keys: | + ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}- + ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- + ${{ env.cache-name }}-${{ runner.os }}- - - name: Cache Cabal + - name: dist-newstyle cache uses: actions/cache@v2 env: - cache-name: cache-cabal + cache-name: dist-newstyle with: - path: | - ~/.cabal/packages - ~/.cabal/store - key: v2-${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }} + path: dist-newstyle + key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project') }} restore-keys: | - v2-${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }} - v2-${{ runner.os }}-${{ matrix.ghc }}-build- - v2-${{ runner.os }}-${{ matrix.ghc }} + ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}- + ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- + ${{ env.cache-name }}-${{ runner.os }}- - name: "Run cabal check" run: | diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 771c4fbd24..e39071c0ca 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -1,10 +1,5 @@ name: Nix -# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. -concurrency: - group: ${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true - on: pull_request: branches: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 086fc7d0e4..f9ecf669c9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,11 +4,6 @@ defaults: run: shell: bash -# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. -concurrency: - group: ${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true - on: pull_request: branches: @@ -40,7 +35,8 @@ jobs: strategy: fail-fast: true matrix: - ghc: ["9.0.1", '8.10.7', '8.10.6', "8.10.5", "8.8.4", "8.8.3", "8.6.5"] + ghc: ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.8.3", "8.6.5"] + cabal: ["3.6"] os: [ubuntu-latest, macOS-latest] include: # only test supported ghc major versions @@ -68,8 +64,6 @@ jobs: # only build rest of supported ghc versions for windows - os: windows-latest ghc: '8.10.6' - - os: windows-latest - ghc: '8.10.5' - os: windows-latest ghc: '8.8.4' @@ -78,32 +72,24 @@ jobs: with: submodules: true - uses: haskell/actions/setup@v1 + id: HaskEnvSetup with: ghc-version: ${{ matrix.ghc }} - cabal-version: "3.4" + cabal-version: ${{ matrix.cabal }} - - run: ./fmt.sh - name: "HLint via ./fmt.sh" + - name: "HLint via ./fmt.sh" + run: ./fmt.sh - - if: matrix.os == 'windows-latest' - name: Set some window specific things + - if: runner.os == 'Windows' + name: (Windows) Platform config run: | - echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV - - if: matrix.os != 'windows-latest' - name: Set some linux/macOS specific things - run: | - echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV - echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV - - - if: matrix.os == 'macOS-latest' && matrix.ghc == '8.10.5' - name: Workaround for GHC 8.10.5 on macOS + - if: ( runner.os == 'Linux' ) || ( runner.os == 'macOS' ) + name: (Linux,macOS) Platform config run: | - echo "# uninstalling CommandLineTools (see https://github.com/haskell/haskell-language-server/issues/1913#issuecomment-861667786)" - sudo rm -rf /Library/Developer/CommandLineTools + echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV - # 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: Use modified cabal.project for ghc9 run: cp cabal-ghc901.project cabal.project @@ -111,26 +97,10 @@ jobs: - if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest' name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows run: | - echo "package floskell" >> cabal.project + echo "package floskell" >> cabal.project echo " ghc-options: -O0" >> cabal.project - - name: Cache Cabal - uses: actions/cache@v2 - env: - cache-name: cache-cabal - with: - path: | - ${{ env.CABAL_PKGS_DIR }} - ${{ env.CABAL_STORE_DIR }} - key: v2-${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }} - restore-keys: | - v2-${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }} - v2-${{ runner.os }}-${{ matrix.ghc }}-build- - v2-${{ runner.os }}-${{ matrix.ghc }} - - - run: cabal update - - # Need this to work around filepath length limits in Windows + # Work around for filepath length limits in Windows - name: Shorten binary names run: | sed -i.bak -e 's/haskell-language-server/hls/g' \ @@ -139,9 +109,57 @@ jobs: sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \ src/**/*.hs exe/*.hs + - name: Retrieving `cabal.project` Hackage timestamp + run: | + # Form: index-state: 2021-11-29T08:11:08Z + INDEX_STATE_ENTRY=$(grep index-state cabal.project) + # Form: 2021-11-29T08-11-08Z + INDEX_STATE1=$(echo "$INDEX_STATE_ENTRY" | cut -d' ' -f2 | tr ':' '-') + echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV + + # 2021-12-02: NOTE: Cabal Hackage source tree storage does not depend on OS or GHC really, + # but can depend on `base`. + # But this caching is happens only inside `master` for `master` purposes of compiling the deps + # so having a shared pool here that depends only on Hackage pin & does not depend on `base` is "good enough" + # & used such because it preserves 10% of a global cache storage pool. + - name: Hackage sources cache + uses: actions/cache@v2 + env: + cache-name: hackage-sources + with: + path: ${{ env.CABAL_PKGS_DIR }} + key: ${{ env.cache-name }}-${{ env.INDEX_STATE }} + restore-keys: ${{ env.cache-name }}- + + - name: Compiled deps cache + uses: actions/cache@v2 + env: + cache-name: compiled-deps + with: + path: ${{ steps.HaskEnvSetup.outputs.cabal-store }} + key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project') }} + restore-keys: | + ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}- + ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- + ${{ env.cache-name }}-${{ runner.os }}- + + - name: dist-newstyle cache + uses: actions/cache@v2 + env: + cache-name: dist-newstyle + with: + path: dist-newstyle + key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project') }} + restore-keys: | + ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}- + ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- + ${{ env.cache-name }}-${{ runner.os }}- + + - run: cabal v2-update + # repeating builds to workaround segfaults in windows and ghc-8.8.4 - - name: Build - run: cabal build || cabal build || cabal build + - name: Build, try x3 times + run: cabal v2-build || cabal v2-build - name: Set test options run: | @@ -150,10 +168,10 @@ jobs: - name: Cache test log bewteen attempts of the same run uses: actions/cache@v2 env: - cache-name: cache-test-log + cache-name: test-log with: path: .tasty-rerun-log - key: v1-${{ runner.os }}-${{ matrix.ghc }}-test-log-${{ github.sha }} + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-name }}-${{ github.sha }} - if: needs.pre_job.outputs.should_skip_ghcide != 'true' && matrix.test name: Test ghcide @@ -216,6 +234,7 @@ jobs: - if: matrix.test && matrix.ghc != '9.0.1' && !(matrix.os == 'ubuntu-latest' && matrix.ghc == '8.6.5') name: Test hls-tactics-plugin test suite run: cabal test hls-tactics-plugin --test-options="$TEST_OPTS" || cabal test hls-tactics-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-tactics-plugin --test-options="$TEST_OPTS" + continue-on-error: true - if: matrix.test name: Test hls-refine-imports-plugin test suite diff --git a/cabal-ghc901.project b/cabal-ghc901.project index 18e63db8f3..52dc14e00f 100644 --- a/cabal-ghc901.project +++ b/cabal-ghc901.project @@ -37,7 +37,7 @@ package * write-ghc-environment-files: never -index-state: 2021-11-29T08:11:07Z +index-state: 2021-11-29T08:11:09Z constraints: -- These plugins don't work on GHC9 yet diff --git a/cabal-ghc921.project b/cabal-ghc921.project index 5706da094e..71edd79f10 100644 --- a/cabal-ghc921.project +++ b/cabal-ghc921.project @@ -36,7 +36,7 @@ package * write-ghc-environment-files: never -index-state: 2021-11-29T08:11:07Z +index-state: 2021-11-29T08:11:09Z constraints: -- These plugins doesn't work on GHC92 yet diff --git a/cabal.project b/cabal.project index 90c322cc4f..6cdf417a56 100644 --- a/cabal.project +++ b/cabal.project @@ -40,7 +40,7 @@ package * write-ghc-environment-files: never -index-state: 2021-11-29T08:11:07Z +index-state: 2021-11-29T08:11:09Z constraints: hyphenation +embed