Improvements #4
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| formatting: | |
| name: Formatting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: haskell-actions/run-fourmolu@v11 | |
| with: | |
| version: "0.17.0.0" | |
| lint: | |
| name: HLint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: haskell-actions/hlint-setup@v2 | |
| with: | |
| version: "3.8" | |
| - uses: haskell-actions/hlint-run@v2 | |
| with: | |
| path: '["src/", "test/"]' | |
| fail-on: warning | |
| build: | |
| name: Build and test - GHC ${{ matrix.ghc }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ghc: | |
| - 9.6.7 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: haskell-actions/setup@v2 | |
| id: setup-haskell | |
| with: | |
| ghc-version: ${{ matrix.ghc }} | |
| cabal-version: 3.14.2.0 | |
| - name: Create freeze file | |
| run: cabal freeze --enable-tests | |
| - name: Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.setup-haskell.outputs.cabal-store }} | |
| key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | |
| restore-keys: ${{ runner.os }}-ghc-${{ matrix.ghc }}- | |
| - name: Check the cabal file formatting | |
| if: ${{ matrix.ghc == '9.6.7' }} | |
| run: | | |
| # --ignore-project, so that cabal.project.freeze does not constrain | |
| # the dependencies of cabal-fmt itself. | |
| cabal install --ignore-project --install-method=copy --overwrite-policy=always cabal-fmt-0.1.12 | |
| git ls-files '*.cabal' | xargs -r "$HOME/.cabal/bin/cabal-fmt" --check | |
| - name: Build | |
| run: cabal build all | |
| - name: Test | |
| run: cabal test all --test-show-details=direct |