@@ -2,57 +2,83 @@ name: Haskell CI
22
33on :
44 push :
5+ pull_request :
56 workflow_dispatch :
67
78permissions :
89 contents : read
910
1011jobs :
11- nix-ci :
12+ fourmolu :
1213 runs-on : ubuntu-latest
13- env :
14- NIX_CONFIG : accept-flake-config = true
1514
1615 steps :
1716 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1817
19- - name : Check Nix flake inputs
20- uses : DeterminateSystems/flake-checker-action@3164002371bc90729c68af0e24d5aacf20d7c9f6 # v12
18+ - uses : haskell-actions/run-fourmolu@v11
19+ with :
20+ version : " 0.17.0.0"
2121
22- - name : Install Nix
23- uses : DeterminateSystems/nix-installer-action@c5a866b6ab867e88becbed4467b93592bce69f8a # v21
22+ build :
23+ name : GHC ${{ matrix.ghc-version }} on ${{ matrix.os }}
24+ runs-on : ${{ matrix.os }}
25+ strategy :
26+ fail-fast : false
27+ matrix :
28+ os : [ubuntu-latest, macos-latest, windows-latest]
29+ ghc-version : ["9.6.7"]
2430
25- - name : Enable Nix cache
26- uses : DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
31+ steps :
32+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
34+ - name : Set up GHC ${{ matrix.ghc-version }}
35+ uses : haskell-actions/setup@v2
36+ id : setup
37+ with :
38+ ghc-version : ${{ matrix.ghc-version }}
39+ cabal-version : " 3.16.0.0"
2740
28- - name : Show toolchain versions from nix shell
41+ - name : Show toolchain versions
2942 shell : bash
3043 run : |
31- nix develop --command bash -lc 'ghc --numeric-version'
32- nix develop --command bash -lc 'cabal --numeric-version'
33- nix develop --command bash -lc 'stack --numeric-version || true'
34- nix develop --command bash -lc 'fourmolu --version'
35-
36- - name : Check formatting
37- run : nix develop --command make format-check
44+ ghc --numeric-version
45+ cabal --numeric-version
3846
3947 - name : Check cabal file
40- run : nix develop --command make cabal- check
48+ run : cabal check
4149
4250 - name : Update cabal package index
43- run : nix develop --command make cabal- update
51+ run : cabal update
4452
4553 - name : Configure the build
46- run : nix develop --command make configure
54+ run : |
55+ cabal configure --enable-tests --enable-benchmarks --disable-documentation
56+ cabal build --dry-run
57+
58+ - name : Restore cabal store cache
59+ uses : actions/cache/restore@v4
60+ id : cache-restore
61+ with :
62+ path : ${{ steps.setup.outputs.cabal-store }}
63+ key : ${{ runner.os }}-ghc-${{ matrix.ghc-version }}-cabal-${{ hashFiles('**/plan.json') }}
64+ restore-keys : |
65+ ${{ runner.os }}-ghc-${{ matrix.ghc-version }}-cabal-
4766
4867 - name : Build dependencies
49- run : nix develop --command make deps
68+ run : cabal build --only-dependencies
69+
70+ - name : Save cabal store cache
71+ uses : actions/cache/save@v4
72+ if : steps.cache-restore.outputs.cache-hit != 'true'
73+ with :
74+ path : ${{ steps.setup.outputs.cabal-store }}
75+ key : ${{ steps.cache-restore.outputs.cache-primary-key }}
5076
5177 - name : Build the package
52- run : nix develop --command make build
78+ run : cabal build all
5379
5480 - name : Run tests
55- run : nix develop --command make test
81+ run : cabal test all
5682
5783 - name : Build documentation
58- run : nix develop --command make docs
84+ run : cabal haddock all --disable-documentation
0 commit comments