Coveralls and stack support #281
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 | |
| 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: | |
| test-with-cabal: | |
| name: Haskell-CI - Linux - cabal - ${{ matrix.ghc-version }} | |
| strategy: | |
| matrix: | |
| ghc-version: [latest, 9.12, "9.10", 9.8, 9.6] | |
| os: [ubuntu-latest] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: ${{matrix.ghc-version}} | |
| - uses: actions/cache/restore@v4 | |
| with: | |
| key: ${{ matrix.os }}-${{ matrix.ghc-version }}-${{ github.sha }} | |
| path: ~/.cabal/store | |
| restore-keys: ${{ matrix.os }}-${{ matrix.ghc-version }}- | |
| - run: cabal build all | |
| - run: cabal test all | |
| - run: cabal haddock all | |
| - uses: actions/cache/save@v4 | |
| with: | |
| key: ${{ matrix.os }}-${{ matrix.ghc-version }}-${{ github.sha }} | |
| path: ~/.cabal/store | |
| test-with-stack: | |
| name: Stack | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: haskell-actions/setup@v2 | |
| id: setup-haskell-stack | |
| name: Setup Haskell | |
| with: | |
| enable-stack: true | |
| stack-version: latest | |
| ghc-version: 9.10.3 | |
| - name: Cache | |
| id: cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ steps.setup-haskell-stack.outputs.stack-root }} | |
| .stack-work | |
| key: ${{ runner.os }}-lts-24-${{ github.sha }} | |
| restore-keys: ${{ runner.os }}-lts-24 | |
| - name: Test | |
| run: | | |
| set -ex | |
| stack test --coverage | |
| stack hpc report --all | |
| - uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| ${{ steps.setup-haskell-stack.outputs.stack-root }} | |
| .stack-work | |
| key: ${{ runner.os }}-lts-24-${{ github.sha }} | |
| - name: Upload coverage report | |
| env: | |
| COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
| run: | | |
| [ -n "${COVERALLS_REPO_TOKEN}" ] | |
| stack path --local-hpc-root | |
| curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.7.0/shc-Linux-X64.tar.bz2 | tar xj shc | |
| ./shc --repo-token="$COVERALLS_REPO_TOKEN" --partial-coverage --fetch-coverage combined custom |