diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index cf248d8664..90d0d05ada 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -85,6 +85,9 @@ jobs: INDEX_STATE1=$(echo "$INDEX_STATE_ENTRY" | cut -d' ' -f2 | tr ':' '-') echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV + # To ensure we get the lastest hackage index and not relying on haskell action logic + - run: cabal update + - name: Form the package list ('cabal.project.freeze') id: compute-cache-key run: | @@ -96,8 +99,6 @@ jobs: echo '' || \ 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 @@ -121,9 +122,6 @@ jobs: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- ${{ env.cache-name }}-${{ runner.os }}- - # To ensure we get the lastest hackage index and not relying on haskell action logic - - run: cabal update - # max-backjumps is increased as a temporary solution # for dependency resolution failure - run: cabal configure --enable-benchmarks --max-backjumps 12000 diff --git a/.github/workflows/caching.yml b/.github/workflows/caching.yml index 61c05d8936..789ec0ff46 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -142,6 +142,9 @@ jobs: INDEX_STATE1=$(echo "$INDEX_STATE_ENTRY" | cut -d' ' -f2 | tr ':' '-') echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV + # To ensure we get the lastest hackage index and not relying on haskell action logic + - run: cabal update + - name: Form the package list ('cabal.project.freeze') id: compute-cache-key run: | @@ -153,8 +156,6 @@ jobs: echo '' || \ 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`. @@ -183,10 +184,6 @@ jobs: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- ${{ env.cache-name }}-${{ runner.os }}- - # To ensure we get the lastest hackage index and not relying on haskell action logic - - if: steps.compiled-deps.outputs.cache-hit != 'true' - run: cabal update - - if: steps.compiled-deps.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ghc == '8.10.7' name: Download sources for bench # Downloaded separately, to match the tested work/PR workflow guarantees diff --git a/.github/workflows/flags.yml b/.github/workflows/flags.yml index 3fe0ac69d2..608d9ed544 100644 --- a/.github/workflows/flags.yml +++ b/.github/workflows/flags.yml @@ -85,8 +85,11 @@ jobs: INDEX_STATE1=$(echo "$INDEX_STATE_ENTRY" | cut -d' ' -f2 | tr ':' '-') echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV + # To ensure we get the lastest hackage index and not relying on haskell action logic + - run: cabal update + - name: Form the package list ('cabal.project.freeze') - continue-on-error: true + id: compute-cache-key run: | cabal v2-freeze && \ echo "" && \ @@ -95,6 +98,9 @@ jobs: cat 'cabal.project.freeze' && \ echo "" || \ echo 'WARNING: Could not produce the `freeze`.' + echo ::set-output name=value::${{ hashFiles('cabal.project.freeze') }} + # Removing freeze file as it breaks builds with alternative flags + rm -rf cabal.project.freeze - name: Hackage sources cache uses: actions/cache@v2 @@ -112,16 +118,12 @@ 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 }}- ${{ env.cache-name }}-${{ runner.os }}- - # To ensure we get the lastest hackage index and not relying on haskell action logic - - if: steps.compiled-deps.outputs.cache-hit != 'true' - run: cabal update - - name: Build `hls-graph` with flags run: cabal v2-build hls-graph --flags="pedantic embed-files stm-stats" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9430e72156..7ed443d518 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -146,6 +146,9 @@ jobs: INDEX_STATE1=$(echo "$INDEX_STATE_ENTRY" | cut -d' ' -f2 | tr ':' '-') echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV + # To ensure we get the lastest hackage index and not relying on haskell action logic + - run: cabal update + - name: Compute the cache key id: compute-cache-key run: | @@ -157,8 +160,6 @@ jobs: echo '' || \ 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 @@ -182,10 +183,6 @@ jobs: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- ${{ env.cache-name }}-${{ runner.os }}- - # To ensure we get the lastest hackage index and not relying on haskell action logic - - if: steps.compiled-deps.outputs.cache-hit != 'true' - run: cabal update - # repeating builds to workaround segfaults in windows and ghc-8.8.4 - name: Build run: cabal build || cabal build || cabal build