diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index fceb47178a..01821c8444 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -86,7 +86,7 @@ jobs: echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV - name: Form the package list ('cabal.project.freeze') - continue-on-error: true + id: compute-cache-key run: | cabal v2-freeze && \ echo '' && \ @@ -94,15 +94,18 @@ jobs: echo '' && \ cat 'cabal.project.freeze' && \ echo '' || \ - echo 'WARNING: Could not produce the `freeze`. + echo 'WARNING: Could not produce the `freeze`.' + echo ::set-output name=value::${{ hashFiles('cabal.project.freeze') }} + # Removing freeze file as it can break builds using allow-newer + rm -f cabal.project.freeze - 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 }} + path: ${{ env.CABAL_PKGS_DIR }} + key: ${{ env.cache-name }}-${{ env.INDEX_STATE }} restore-keys: ${{ env.cache-name }}- - name: Compiled deps cache @@ -112,7 +115,7 @@ jobs: 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.freeze') }} + key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ steps.compute-cache-key.outputs.value }} restore-keys: | ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}- ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- diff --git a/.github/workflows/caching.yml b/.github/workflows/caching.yml index 0cfc530dd7..34ff476a71 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -143,7 +143,7 @@ jobs: echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV - name: Form the package list ('cabal.project.freeze') - continue-on-error: true + id: compute-cache-key run: | cabal v2-freeze && \ echo '' && \ @@ -151,7 +151,10 @@ jobs: echo '' && \ cat 'cabal.project.freeze' && \ echo '' || \ - echo 'WARNING: Could not produce the `freeze`. + echo 'WARNING: Could not produce the `freeze`.' + echo ::set-output name=value::${{ hashFiles('cabal.project.freeze') }} + # Removing freeze file as it can break builds using allow-newer + rm -f cabal.project.freeze # 2021-12-02: NOTE: Cabal Hackage source tree storage does not depend on OS or GHC really, # but can depend on `base`. @@ -164,10 +167,8 @@ jobs: cache-name: hackage-sources with: path: ${{ env.CABAL_PKGS_DIR }} - key: ${{ env.cache-name }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project.freeze') }} - restore-keys: | - ${{ env.cache-name }}-${{ env.INDEX_STATE }}- - ${{ env.cache-name }}- + key: ${{ env.cache-name }}-${{ env.INDEX_STATE }} + restore-keys: ${{ env.cache-name }}- - name: Compiled deps cache id: compiled-deps @@ -176,7 +177,7 @@ jobs: 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.freeze') }} + key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ steps.compute-cache-key.outputs.value }} restore-keys: | ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}- ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 953503ee85..bde2e92a50 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -146,8 +146,8 @@ jobs: INDEX_STATE1=$(echo "$INDEX_STATE_ENTRY" | cut -d' ' -f2 | tr ':' '-') echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV - - name: Form the package list ('cabal.project.freeze') - continue-on-error: true + - name: Compute the cache key + id: compute-cache-key run: | cabal v2-freeze && \ echo '' && \ @@ -155,15 +155,18 @@ jobs: echo '' && \ cat 'cabal.project.freeze' && \ echo '' || \ - echo 'WARNING: Could not produce the `freeze`. + echo 'WARNING: Could not produce the `freeze`.' + echo ::set-output name=value::${{ hashFiles('cabal.project.freeze') }} + # Removing freeze file as it can break builds using allow-newer + rm -rf cabal.project.freeze - 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 }} + path: ${{ env.CABAL_PKGS_DIR }} + key: ${{ env.cache-name }}-${{ env.INDEX_STATE }} restore-keys: ${{ env.cache-name }}- - name: Compiled deps cache @@ -173,7 +176,7 @@ jobs: 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.freeze') }} + key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ steps.compute-cache-key.outputs.value }} restore-keys: | ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}- ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- @@ -229,6 +232,10 @@ jobs: name: Test hls-brittany-plugin run: cabal test hls-brittany-plugin --test-options="$TEST_OPTS" || cabal test hls-brittany-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-brittany-plugin --test-options="$TEST_OPTS" + - if: matrix.test + name: Test hls-floskell-plugin + run: cabal test hls-floskell-plugin --test-options="$TEST_OPTS" || cabal test hls-floskell-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-floskell-plugin --test-options="$TEST_OPTS" + - if: matrix.test name: Test hls-class-plugin run: cabal test hls-class-plugin --test-options="$TEST_OPTS" || cabal test hls-class-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-class-plugin --test-options="$TEST_OPTS"