Merge pull request #8 from commercialhaskell/ci #5
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: Unit tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| # As of 2026-06-30: | |
| # * ubuntu-latest comes with Stack 3.11.1 and GHC 9.14.1 | |
| # * windows-latest comes with Stack 3.11.1 and GHC 9.14.1 | |
| # * macos-latest does not come with Haskell tools | |
| jobs: | |
| unit-tests: | |
| name: Unit tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| snapshot: | |
| - stack-ghc-9.8.4.yaml | |
| - stack-ghc-9.10.3.yaml | |
| - stack-ghc-9.12.4.yaml | |
| - stack-ghc-9.14.1.yaml | |
| include: | |
| - os: windows-latest | |
| snapshot: stack-ghc-9.10.3.yaml | |
| - os: macos-latest | |
| snapshot: stack-ghc-9.10.3.yaml | |
| steps: | |
| - name: Clone project | |
| uses: actions/checkout@v7 | |
| - name: Cache dependencies on Unix-like OS | |
| if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.stack | |
| key: ${{ runner.os }}-${{ matrix.snapshot }} | |
| - name: Cache dependencies on Windows | |
| if: startsWith(runner.os, 'Windows') | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| ~\AppData\Roaming\stack | |
| ~\AppData\Local\Programs\stack | |
| key: ${{ runner.os }}-${{ matrix.snapshot }} | |
| - name: Run tests | |
| shell: bash | |
| run: | | |
| set -ex | |
| if [[ "${{ matrix.os }}" == "macos-latest" ]] | |
| then | |
| # As at 2026-06-30: | |
| # | |
| # * macos-latest does not include Haskell tools. | |
| curl -sSL https://get.haskellstack.org/ | sh | |
| fi | |
| stack --snapshot ${{ matrix.snapshot }} test --bench --no-run-benchmarks --haddock --no-haddock-deps |