Merge pull request #147 from commercialhaskell/Typeable #269
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: Tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| # As of 2025-07-26, ubuntu-latest and windows-latest come with Stack 3.7.1. | |
| # However, macos-13 and macos-latest do not come with Haskell tools. | |
| jobs: | |
| build: | |
| name: CI | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| snapshot: | |
| - stack-ghc-9.6.7.yaml | |
| - stack-ghc-9.8.4.yaml | |
| - stack-ghc-9.10.2.yaml | |
| - stack-ghc-9.12.2.yaml | |
| include: | |
| - os: macos-13 | |
| snapshot: stack-ghc-9.10.2.yaml | |
| # macos-latest provides macOS/AArch64 (M1) | |
| - os: macos-latest | |
| snapshot: stack-ghc-9.10.2.yaml | |
| - os: windows-latest | |
| snapshot: stack-ghc-9.10.2.yaml | |
| steps: | |
| - name: Clone project | |
| uses: actions/checkout@v4 | |
| - name: Cache dependencies on Unix-like OS | |
| if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.stack | |
| key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.snapshot }} | |
| - name: Cache dependencies on Windows | |
| if: startsWith(runner.os, 'Windows') | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~\AppData\Roaming\stack | |
| ~\AppData\Local\Programs\stack | |
| key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.snapshot }} | |
| - name: Build and run tests | |
| shell: bash | |
| run: | | |
| set -ex | |
| if [[ "${{ matrix.os }}" == "macos-13" || "${{ matrix.os }}" == "macos-latest" ]] | |
| then | |
| # macos-13 and macos-latest do not include Haskell tools as at 2025-07-26. | |
| curl -sSL https://get.haskellstack.org/ | sh | |
| fi | |
| stack --snapshot ${{ matrix.snapshot }} test --bench --no-run-benchmarks --haddock --no-haddock-deps | |
| test-pretty-exceptions: | |
| name: Test build of test-pretty-exceptions | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| snapshot: | |
| - stack-ghc-9.10.2.yaml | |
| steps: | |
| - name: Clone project | |
| uses: actions/checkout@v4 | |
| - name: Cache dependencies on Unix-like OS | |
| if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.stack | |
| key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.snapshot }}-pretty | |
| - name: Cache dependencies on Windows | |
| if: startsWith(runner.os, 'Windows') | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~\AppData\Roaming\stack | |
| ~\AppData\Local\Programs\stack | |
| key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.snapshot }}-pretty | |
| - name: Build test-pretty-exceptions | |
| shell: bash | |
| run: | | |
| set -ex | |
| stack --snapshot ${{ matrix.snapshot }} build --flag pantry:test-pretty-exceptions |