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 | ||
|
Check failure on line 1 in .github/workflows/haskell-ci.yml
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| on: | ||
| push: | ||
| branches: | ||
| - 'master' | ||
| pull_request: | ||
| branches: | ||
| - 'master' | ||
| schedule: | ||
| - cron: 0 0 * * * | ||
| env: | ||
| latest_ghc: "9.12" | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| linux: | ||
| name: Haskell-CI - ${{ matrix.ghc-version }} - ${{ matrix.ref }} | ||
| strategy: | ||
| matrix: | ||
| ghc-version: ["${{ env.latest_ghc }}", "9.10", "9.8", "9.6"] | ||
| ref: ["${{ github.head_ref }}"] | ||
| include: | ||
| - ghc-version: ${{ env.latest_ghc }} | ||
| ref: master | ||
| fail-fast: false | ||
| 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@v4 | ||
| with: | ||
| key: ${{ matrix.ghc-version }}-${{ matrix.ref }} | ||
| path: | | ||
| ~/.cabal/store | ||
| dist-newstyle | ||
| .hpc | ||
| restore-keys: ${{ matrix.ghc-version }}- | ||
| - if: ${{ github.event.pull_request }} | ||
| run: | | ||
| cat <<EOF >>cabal.project.local | ||
| program-options | ||
| ghc-options: -fhpc | ||
| EOF | ||
| - run: cabal build all | ||
| - run: cabal test all | ||
| - run: cabal haddock all | ||
| # 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 from `master` | ||
| 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: | ||
| comment-id: ${{ steps.fc.outputs.comment-id }} | ||
| issue-number: ${{ github.event.pull_request.number }} | ||
| body-path: coverage-report.md | ||
| edit-mode: replace | ||