Basic code coverage feedback #117
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Haskell-CI | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| pull_request: | |
| branches: | |
| - 'master' | |
| schedule: | |
| - cron: 0 0 * * * | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| linux: | |
| name: Haskell-CI - Linux - ${{ matrix.ghc-version }} | |
| strategy: | |
| matrix: | |
| ghc-version: [latest, 9.12, "9.10", 9.8, 9.6] | |
| fail-fast: false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: ${{matrix.ghc-version}} | |
| - uses: actions/cache@v4 | |
| with: | |
| key: ${{ matrix.ghc-version }}-${{ github.sha }} | |
| path: | | |
| ~/.cabal/store | |
| dist-newstyle | |
| .hpc | |
| restore-keys: ${{ matrix.ghc-version }}- | |
| - run: cabal build all --ghc-options=-fhpc | |
| - run: cabal test all --ghc-options=-fhpc | |
| - run: ./scripts/generate-coverage-comment.sh constrained.tix > coverage-report.md | |
| - run: cat coverage-report.md | |
| - run: cabal haddock all --ghc-options=-fhpc | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: constrained-${{matrix.ghc-version}}-coverage | |
| path: coverage-report.md | |
| if-no-files-found: error | |
| compression-level: 0 | |
| retention-days: 1 | |
| # TODO: turn this on in the next PR and figure out how to present both reports | |
| # master-coverage: | |
| # name: Check coverage on master | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # ref: master | |
| # - uses: haskell-actions/setup@v2 | |
| # with: | |
| # ghc-version: latest | |
| # - uses: actions/cache@v4 | |
| # with: | |
| # key: master | |
| # path: | | |
| # ~/.cabal/store | |
| # dist-newstyle | |
| # .hpc | |
| # - run: cabal build all --ghc-options=-fhpc | |
| # - run: cabal test all --ghc-options=-fhpc | |
| # - run: ./scripts/generate-coverage-comment.sh constrained.tix > coverage-report-master.md | |
| # - run: cat coverage-report-master.md | |
| # - name: Upload coverage report | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: constrained-master-coverage | |
| # path: coverage-report-master.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-latest-coverage' | |
| merge-multiple: true | |
| - run: 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: | |
| comment-id: ${{ steps.fc.outputs.comment-id }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body-path: coverage-report.md | |
| edit-mode: replace |