diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index cf713e2f1c2..e3185c56def 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -88,11 +88,13 @@ jobs: - name: Form the package list ('cabal.project.freeze') continue-on-error: true run: | - cabal v2-freeze - echo '' - echo 'Output:' - echo '' - cat 'cabal.project.freeze' + cabal v2-freeze && \ + echo '' && \ + echo 'Output:' && \ + echo '' && \ + cat 'cabal.project.freeze' && \ + echo '' || \ + echo 'WARNING: Could not produce the `freeze`. - name: Hackage sources cache uses: actions/cache@v2 @@ -116,8 +118,6 @@ jobs: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- ${{ env.cache-name }}-${{ runner.os }}- - - 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 66ab4cd8763..0f911119716 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -45,7 +45,7 @@ on: - cron: "25 2/8 * * *" env: - cabalBuild: "v2-build all --enable-tests --enable-benchmarks --keep-going" + cabalBuild: "v2-build all --keep-going" jobs: @@ -145,11 +145,13 @@ jobs: - name: Form the package list ('cabal.project.freeze') continue-on-error: true run: | - cabal v2-freeze - echo '' - echo 'Output:' - echo '' - cat 'cabal.project.freeze' + cabal v2-freeze && \ + echo '' && \ + echo 'Output:' && \ + echo '' && \ + cat 'cabal.project.freeze' && \ + echo '' || \ + echo 'WARNING: Could not produce the `freeze`. # 2021-12-02: NOTE: Cabal Hackage source tree storage does not depend on OS or GHC really, # but can depend on `base`. @@ -180,27 +182,34 @@ jobs: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}- ${{ env.cache-name }}-${{ runner.os }}- - - if: steps.compiled-deps.outputs.cache-hit != 'true' + - 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 run: | - cabal update + cabal $cabalBuild --only-download --enable-benchmarks - if: steps.compiled-deps.outputs.cache-hit != 'true' - name: Download all sources + name: Download the rest of the sources + # Downloaded separately, to match the tested work/PR workflow guarantees run: | - cabal $cabalBuild --only-download + cabal $cabalBuild --only-download --enable-tests # repeating builds to workaround segfaults in windows and ghc-8.8.4 # This build agenda in not to have successful code, - # but to cache what can be cached, so step is fault tolerant & would always succseed. - # 2021-12-11: NOTE: Building all targets, since - # current Cabal does not allow `all --enable-tests --enable-benchmarks --only-dependencies` - - if: steps.compiled-deps.outputs.cache-hit != 'true' - name: Build all targets; try 3 times + # but to cache what can be cached, so step is fault tolerant & would always succeed. + # 2021-12-11: NOTE: Need to building all targets (build the project also), since + # current Cabal does not allow `all --enable-tests --enable-benchmarks --only-dependencies` combination + + - if: steps.compiled-deps.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ghc == '8.10.7' + name: (For Bench workflow) Build benchmark targets continue-on-error: true + # Downloaded separately, to match the tested work/PR workflow guarantees run: | - cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild + cabal $cabalBuild --enable-benchmarks || cabal $cabalBuild --enable-benchmarks || cabal $cabalBuild --enable-benchmarks - # Despite the `continue-on-error: true` directive - CI does not ignore the return code of the last step - - name: Workaround to CI platform + - if: steps.compiled-deps.outputs.cache-hit != 'true' + name: Build targets; try 3 times + continue-on-error: true + # Done separately, matching the tested work/PR workflow guarantees run: | - true + cabal $cabalBuild --enable-test || cabal $cabalBuild --enable-test || cabal $cabalBuild --enable-test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f16d1c1f2ec..6d52f515ea0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -149,11 +149,13 @@ jobs: - name: Form the package list ('cabal.project.freeze') continue-on-error: true run: | - cabal v2-freeze - echo '' - echo 'Output:' - echo '' - cat 'cabal.project.freeze' + cabal v2-freeze && \ + echo '' && \ + echo 'Output:' && \ + echo '' && \ + cat 'cabal.project.freeze' && \ + echo '' || \ + echo 'WARNING: Could not produce the `freeze`. - name: Hackage sources cache uses: actions/cache@v2 @@ -177,8 +179,6 @@ jobs: ${{ 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