Add flake check and push

This commit is contained in:
Bryan Richter 2026-02-12 14:36:46 +02:00
parent 8c9e35c8ba
commit 720f6af78d
No known key found for this signature in database
GPG Key ID: B202264020068BFB

View File

@ -1,15 +1,13 @@
name: build
name: check and push
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
stack-test:
name: stack test
runs-on: ubuntu-latest
name: Haskell GHC
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
@ -22,6 +20,34 @@ jobs:
~/.stack
.stack-work
key: ${{ runner.os }}-${{ hashFiles('**/*.cabal','**/stack.yaml') }}
# If there's no match for key, fall back to these:
restore-keys: |
${{ runner.os }}-
- run: stack build
- run: stack test
flake-no-push:
name: flake check (no push)
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- uses: cachix/cachix-action@v15
with:
name: stackage-infrastructure
- run: nix build
- run: nix flake check
flake-push:
name: flake check and push
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- uses: cachix/cachix-action@v31
with:
name: stackage-infrastructure
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build
- run: nix flake check