chore: use nix in ci #83
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 | |
| on: | |
| push: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| nix-ci: | |
| runs-on: ubuntu-latest | |
| env: | |
| NIX_CONFIG: accept-flake-config = true | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Install Nix | |
| uses: DeterminateSystems/nix-installer-action@main | |
| - name: Enable Nix cache | |
| uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: Show toolchain versions from nix shell | |
| shell: bash | |
| run: | | |
| nix develop --command bash -lc 'ghc --numeric-version' | |
| nix develop --command bash -lc 'cabal --numeric-version' | |
| nix develop --command bash -lc 'stack --numeric-version || true' | |
| nix develop --command bash -lc 'fourmolu --version' | |
| - name: Check formatting | |
| run: nix develop --command make format-check | |
| - name: Check cabal file | |
| run: nix develop --command make cabal-check | |
| - name: Configure the build | |
| run: nix develop --command make configure | |
| - name: Build dependencies | |
| run: nix develop --command make deps | |
| - name: Build the package | |
| run: nix develop --command make build | |
| - name: Run tests | |
| run: nix develop --command make test | |
| - name: Build documentation | |
| run: nix develop --command make docs |