From 7bdfd2a934dc8cdad851c68065d42075124c4933 Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Thu, 24 Jul 2025 16:11:58 +0200 Subject: [PATCH 01/17] Present code-coverage input in PRs --- .github/workflows/haskell-ci.yml | 106 ++++++++++++++++++++++++--- .gitignore | 1 + scripts/generate-coverage-comment.sh | 4 + 3 files changed, 100 insertions(+), 11 deletions(-) create mode 100755 scripts/generate-coverage-comment.sh diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 2e71619..c1f646e 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -1,5 +1,9 @@ name: Haskell-CI +permissions: + contents: read + pull-requests: write + on: push: branches: @@ -16,30 +20,110 @@ concurrency: jobs: linux: - name: Haskell-CI - Linux - ${{ matrix.ghc-version }} + name: Haskell-CI - ${{ matrix.ghc-version }} - ${{ matrix.ref }} strategy: matrix: - ghc-version: [latest, 9.12, "9.10", 9.8, 9.6] - os: [ubuntu-24.04] + ghc-version: ["9.12", "9.10", "9.8", "9.6"] + ref: ["${{ github.head_ref }}"] + include: + - ghc-version: "9.12" + ref: master fail-fast: false - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: ${{ matrix.ref }} + - uses: haskell-actions/setup@v2 with: ghc-version: ${{matrix.ghc-version}} - - uses: actions/cache/restore@v4 + + - uses: actions/cache@v4 with: - key: ${{ matrix.os }}-${{ matrix.ghc-version }}-${{ github.sha }} - path: ~/.cabal/store - restore-keys: ${{ matrix.os }}-${{ matrix.ghc-version }}- + key: ${{ matrix.ghc-version }}-${{ matrix.ref }} + path: | + ~/.cabal/store + dist-newstyle + .hpc + restore-keys: ${{ matrix.ghc-version }}- + + - if: ${{ github.event.pull_request }} + run: | + cat <>cabal.project.local + program-options + ghc-options: -fhpc + EOF + - run: cabal build all - run: cabal test all - run: cabal haddock all - - uses: actions/cache/save@v4 + + # To get the right version of `generate-coverage-comment.sh` + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + sparse-checkout: + scripts + clean: false + + - if: ${{ github.event.pull_request }} + run: ./scripts/generate-coverage-comment.sh constrained.tix | tee coverage-report-${{matrix.ref}}.md + + - name: Upload coverage report + if: ${{ github.event.pull_request }} + uses: actions/upload-artifact@v4 + with: + name: constrained-${{matrix.ref}}-${{matrix.ghc-version}}-coverage + path: coverage-report-${{matrix.ref}}.md + if-no-files-found: error + compression-level: 0 + retention-days: 1 + + report: + name: Generate coverage comment + + if: github.event.pull_request + + needs: linux + + runs-on: ubuntu-latest + + steps: + - name: Download coverage report + uses: actions/download-artifact@v4 + with: + pattern: 'constrained-${{github.head_ref}}-9.12-coverage' + merge-multiple: true + + - name: Download coverage report + uses: actions/download-artifact@v4 + with: + pattern: 'constrained-master-9.12-coverage' + merge-multiple: true + + - run: | + cat coverage-report-${{github.head_ref}}.md > coverage-report.md + echo "# On master" >> coverage-report.md + cat coverage-report-master.md >> coverage-report.md + cat coverage-report.md + + + - name: Find Comment + uses: peter-evans/find-comment@v3 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: "expressions used" + + - name: Create or update comment + uses: peter-evans/create-or-update-comment@v4 with: - key: ${{ matrix.os }}-${{ matrix.ghc-version }}-${{ github.sha }} - path: ~/.cabal/store + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body-path: coverage-report.md + edit-mode: replace diff --git a/.gitignore b/.gitignore index ff36d4b..3183668 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ cabal.project.local~ .HTF/ .ghc.environment.* *.*.sw* +*.tix diff --git a/scripts/generate-coverage-comment.sh b/scripts/generate-coverage-comment.sh new file mode 100755 index 0000000..1a68d6e --- /dev/null +++ b/scripts/generate-coverage-comment.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "# Coverage report" +hpc report "$1" | awk '{sub(/^[ \t]*/, "&- "); sub(/^ /, ""); print}' From 97e763e2bf723d654a87e9bd93a80dda712b198d Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 17:56:53 +0200 Subject: [PATCH 02/17] Update .github/workflows/haskell-ci.yml Co-authored-by: Neil Mayhew --- .github/workflows/haskell-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index c1f646e..28f60c9 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -99,7 +99,7 @@ jobs: pattern: 'constrained-${{github.head_ref}}-9.12-coverage' merge-multiple: true - - name: Download coverage report + - name: Download coverage report from `master` uses: actions/download-artifact@v4 with: pattern: 'constrained-master-9.12-coverage' From 1de24d278d8b24f6517551ba2e0b692ea6c94690 Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 17:57:23 +0200 Subject: [PATCH 03/17] Update .github/workflows/haskell-ci.yml Co-authored-by: Neil Mayhew --- .github/workflows/haskell-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 28f60c9..2c69bba 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -111,7 +111,6 @@ jobs: cat coverage-report-master.md >> coverage-report.md cat coverage-report.md - - name: Find Comment uses: peter-evans/find-comment@v3 id: fc From e9dea9095b3c205abf3edf14bdda76a412ee4ce4 Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:05:30 +0200 Subject: [PATCH 04/17] wip --- .github/workflows/haskell-ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 2c69bba..dd6a0b2 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -14,6 +14,9 @@ on: schedule: - cron: 0 0 * * * +env: + latest_ghc: "9.12" + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true @@ -24,10 +27,10 @@ jobs: strategy: matrix: - ghc-version: ["9.12", "9.10", "9.8", "9.6"] + ghc-version: ["${{ env.latest_ghc }}", "9.10", "9.8", "9.6"] ref: ["${{ github.head_ref }}"] include: - - ghc-version: "9.12" + - ghc-version: ${{ env.latest_ghc }} ref: master fail-fast: false From 8c1d7cf1cbdf2232ce569d8221e49a847fb56c6a Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:06:24 +0200 Subject: [PATCH 05/17] wip --- .github/workflows/haskell-ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index dd6a0b2..2c69bba 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -14,9 +14,6 @@ on: schedule: - cron: 0 0 * * * -env: - latest_ghc: "9.12" - concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true @@ -27,10 +24,10 @@ jobs: strategy: matrix: - ghc-version: ["${{ env.latest_ghc }}", "9.10", "9.8", "9.6"] + ghc-version: ["9.12", "9.10", "9.8", "9.6"] ref: ["${{ github.head_ref }}"] include: - - ghc-version: ${{ env.latest_ghc }} + - ghc-version: "9.12" ref: master fail-fast: false From 4ef5507ffd23d0a6caa6dd3ba90b8b56df9469c2 Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:12:48 +0200 Subject: [PATCH 06/17] more documentation --- .github/workflows/haskell-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 2c69bba..3797343 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -26,6 +26,9 @@ jobs: matrix: ghc-version: ["9.12", "9.10", "9.8", "9.6"] ref: ["${{ github.head_ref }}"] + # This gives us one run for `master` with ghc version 9.12. + # We use this run to give us "up to date" coverage data that + # we can compare to. include: - ghc-version: "9.12" ref: master @@ -62,7 +65,9 @@ jobs: - run: cabal test all - run: cabal haddock all - # To get the right version of `generate-coverage-comment.sh` + # To get the right version of `generate-coverage-comment.sh`. I.e. the + # one in this PR. This is important in order to get the same + # coverage-counting logic on the PR as on master. - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} From 18c7295c26605b658692da554827f6d4c0a1a661 Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:19:36 +0200 Subject: [PATCH 07/17] try conditioning coverage --- .github/workflows/haskell-ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 3797343..7a461f5 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -14,6 +14,9 @@ on: schedule: - cron: 0 0 * * * +env: + latest_ghc: "9.12" + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true @@ -54,7 +57,7 @@ jobs: .hpc restore-keys: ${{ matrix.ghc-version }}- - - if: ${{ github.event.pull_request }} + - if: ${{ github.event.pull_request and matrix.ghc_version == env.latest_ghc }} run: | cat <>cabal.project.local program-options @@ -69,20 +72,21 @@ jobs: # one in this PR. This is important in order to get the same # coverage-counting logic on the PR as on master. - uses: actions/checkout@v4 + if: ${{ github.event.pull_request and matrix.ghc_version == env.latest_ghc }} with: ref: ${{ github.head_ref }} sparse-checkout: scripts clean: false - - if: ${{ github.event.pull_request }} + - if: ${{ github.event.pull_request and matrix.ghc_version == env.latest_ghc }} run: ./scripts/generate-coverage-comment.sh constrained.tix | tee coverage-report-${{matrix.ref}}.md - name: Upload coverage report - if: ${{ github.event.pull_request }} + if: ${{ github.event.pull_request and matrix.ghc_version == env.latest_ghc }} uses: actions/upload-artifact@v4 with: - name: constrained-${{matrix.ref}}-${{matrix.ghc-version}}-coverage + name: constrained-${{matrix.ref}}-coverage path: coverage-report-${{matrix.ref}}.md if-no-files-found: error compression-level: 0 @@ -101,13 +105,13 @@ jobs: - name: Download coverage report uses: actions/download-artifact@v4 with: - pattern: 'constrained-${{github.head_ref}}-9.12-coverage' + pattern: 'constrained-${{github.head_ref}}-coverage' merge-multiple: true - name: Download coverage report from `master` uses: actions/download-artifact@v4 with: - pattern: 'constrained-master-9.12-coverage' + pattern: 'constrained-master-coverage' merge-multiple: true - run: | From d16b47fb431e86f1806390d0d4b1f86e727dc7fd Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:21:28 +0200 Subject: [PATCH 08/17] wip --- .github/workflows/haskell-ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 7a461f5..ac79aee 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -39,6 +39,9 @@ jobs: runs-on: ubuntu-latest + env: + coverage: ${{ github.event.pull_request && matrix.ghc_version == env.latest_ghc }} + steps: - uses: actions/checkout@v4 with: @@ -57,7 +60,7 @@ jobs: .hpc restore-keys: ${{ matrix.ghc-version }}- - - if: ${{ github.event.pull_request and matrix.ghc_version == env.latest_ghc }} + - if: ${{ env.coverage }} run: | cat <>cabal.project.local program-options @@ -72,18 +75,18 @@ jobs: # one in this PR. This is important in order to get the same # coverage-counting logic on the PR as on master. - uses: actions/checkout@v4 - if: ${{ github.event.pull_request and matrix.ghc_version == env.latest_ghc }} + if: ${{ env.coverage }} with: ref: ${{ github.head_ref }} sparse-checkout: scripts clean: false - - if: ${{ github.event.pull_request and matrix.ghc_version == env.latest_ghc }} + - if: ${{ env.coverage }} run: ./scripts/generate-coverage-comment.sh constrained.tix | tee coverage-report-${{matrix.ref}}.md - name: Upload coverage report - if: ${{ github.event.pull_request and matrix.ghc_version == env.latest_ghc }} + if: ${{ env.coverage }} uses: actions/upload-artifact@v4 with: name: constrained-${{matrix.ref}}-coverage From 45baea99e5b661a8f7fe63fe17d44e580e7bf40c Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:22:09 +0200 Subject: [PATCH 09/17] check coverage in env --- .github/workflows/haskell-ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index ac79aee..1c8933d 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -14,9 +14,6 @@ on: schedule: - cron: 0 0 * * * -env: - latest_ghc: "9.12" - concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true @@ -40,7 +37,7 @@ jobs: runs-on: ubuntu-latest env: - coverage: ${{ github.event.pull_request && matrix.ghc_version == env.latest_ghc }} + coverage: ${{ github.event.pull_request && matrix.ghc_version == "9.12" }} steps: - uses: actions/checkout@v4 From 6572bf7795b6396cba1c70d3f7b2b657e4df9abd Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:24:00 +0200 Subject: [PATCH 10/17] wip --- .github/workflows/haskell-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 1c8933d..d15c835 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest env: - coverage: ${{ github.event.pull_request && matrix.ghc_version == "9.12" }} + coverage: ${{ github.event.pull_request }} && ${{matrix.ghc_version == "9.12" }} steps: - uses: actions/checkout@v4 From 1aa864f6eeed103d27291749a654cd73a0020157 Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:25:42 +0200 Subject: [PATCH 11/17] wip --- .github/workflows/haskell-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index d15c835..545cdf7 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest env: - coverage: ${{ github.event.pull_request }} && ${{matrix.ghc_version == "9.12" }} + coverage: ${{ github.event.pull_request && (matrix.ghc_version == "9.12") }} steps: - uses: actions/checkout@v4 From fad15c604f7e5a620aef46981c6192f77d90bc5e Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:26:26 +0200 Subject: [PATCH 12/17] wip --- .github/workflows/haskell-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 545cdf7..37b8192 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest env: - coverage: ${{ github.event.pull_request && (matrix.ghc_version == "9.12") }} + coverage: ${{ github.event.pull_request && (matrix.ghc_version == '9.12') }} steps: - uses: actions/checkout@v4 From 825791367b3dd4daab163bd742291842ff20552b Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:29:09 +0200 Subject: [PATCH 13/17] wip --- .github/workflows/haskell-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 37b8192..18e3db1 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -57,7 +57,7 @@ jobs: .hpc restore-keys: ${{ matrix.ghc-version }}- - - if: ${{ env.coverage }} + - if: ${{ env.coverage == true }} run: | cat <>cabal.project.local program-options @@ -72,18 +72,18 @@ jobs: # one in this PR. This is important in order to get the same # coverage-counting logic on the PR as on master. - uses: actions/checkout@v4 - if: ${{ env.coverage }} + if: ${{ env.coverage == true }} with: ref: ${{ github.head_ref }} sparse-checkout: scripts clean: false - - if: ${{ env.coverage }} + - if: ${{ env.coverage == true }} run: ./scripts/generate-coverage-comment.sh constrained.tix | tee coverage-report-${{matrix.ref}}.md - name: Upload coverage report - if: ${{ env.coverage }} + if: ${{ env.coverage == true }} uses: actions/upload-artifact@v4 with: name: constrained-${{matrix.ref}}-coverage From 914ccdee1fb445699fa7fddc4fff09d1f212dc28 Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:29:31 +0200 Subject: [PATCH 14/17] wip --- .github/workflows/haskell-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 18e3db1..c8c8bc5 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest env: - coverage: ${{ github.event.pull_request && (matrix.ghc_version == '9.12') }} + coverage: ${{ github.event.pull_request && (matrix.ghc-version == '9.12') }} steps: - uses: actions/checkout@v4 From 4592c6f1d8c9f2e44db7bfda86129bb5d177a77a Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:33:25 +0200 Subject: [PATCH 15/17] wip --- .github/workflows/haskell-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index c8c8bc5..1a9c43c 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -57,6 +57,12 @@ jobs: .hpc restore-keys: ${{ matrix.ghc-version }}- + - run: | + echo ${{ env.coverage }} + echo ${{ github.event.pull_request }} + echo ${{ matrix.ghc-version }} + echo ${{ matrix.ghc-version == '9.12' }} + - if: ${{ env.coverage == true }} run: | cat <>cabal.project.local From cfae5ecccee1b7ca901f2c226f7e3cdf89bf2f08 Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:35:26 +0200 Subject: [PATCH 16/17] wip --- .github/workflows/haskell-ci.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 1a9c43c..7f0c4c1 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -57,13 +57,7 @@ jobs: .hpc restore-keys: ${{ matrix.ghc-version }}- - - run: | - echo ${{ env.coverage }} - echo ${{ github.event.pull_request }} - echo ${{ matrix.ghc-version }} - echo ${{ matrix.ghc-version == '9.12' }} - - - if: ${{ env.coverage == true }} + - if: ${{ env.coverage }} run: | cat <>cabal.project.local program-options @@ -78,18 +72,18 @@ jobs: # one in this PR. This is important in order to get the same # coverage-counting logic on the PR as on master. - uses: actions/checkout@v4 - if: ${{ env.coverage == true }} + if: ${{ env.coverage }} with: ref: ${{ github.head_ref }} sparse-checkout: scripts clean: false - - if: ${{ env.coverage == true }} + - if: ${{ env.coverage }} run: ./scripts/generate-coverage-comment.sh constrained.tix | tee coverage-report-${{matrix.ref}}.md - name: Upload coverage report - if: ${{ env.coverage == true }} + if: ${{ env.coverage }} uses: actions/upload-artifact@v4 with: name: constrained-${{matrix.ref}}-coverage From 2d999617c017eb037a1c282c2c364b43eae61d20 Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 16 Sep 2025 18:40:11 +0200 Subject: [PATCH 17/17] fucking strings --- .github/workflows/haskell-ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 7f0c4c1..ba1493b 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -57,7 +57,7 @@ jobs: .hpc restore-keys: ${{ matrix.ghc-version }}- - - if: ${{ env.coverage }} + - if: ${{ env.coverage == 'true' }} run: | cat <>cabal.project.local program-options @@ -66,24 +66,23 @@ jobs: - run: cabal build all - run: cabal test all - - run: cabal haddock all # To get the right version of `generate-coverage-comment.sh`. I.e. the # one in this PR. This is important in order to get the same # coverage-counting logic on the PR as on master. - uses: actions/checkout@v4 - if: ${{ env.coverage }} + if: ${{ env.coverage == 'true' }} with: ref: ${{ github.head_ref }} sparse-checkout: scripts clean: false - - if: ${{ env.coverage }} + - if: ${{ env.coverage == 'true' }} run: ./scripts/generate-coverage-comment.sh constrained.tix | tee coverage-report-${{matrix.ref}}.md - name: Upload coverage report - if: ${{ env.coverage }} + if: ${{ env.coverage == 'true' }} uses: actions/upload-artifact@v4 with: name: constrained-${{matrix.ref}}-coverage