stackage-server/.github/workflows/build.yml
Bryan Richter c31c0f9669
Reconfigure caching
Caching .stack-work seems sketchy -- I'd rather have a full build of the
local project each time.

~/.ghcup, on the other hand, is the toolchain and seems like a good
cache candidate.
2026-02-12 22:01:25 +02:00

55 lines
1.4 KiB
YAML

name: check and push
on:
push:
branches:
- master
pull_request:
jobs:
stack-test:
name: stack test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.ghcup
~/.stack
key: ${{ runner.os }}-${{ hashFiles('**/*.cabal','**/stack.yaml') }}
# If there's no match for key, fall back to these:
restore-keys: |
${{ runner.os }}-
- uses: haskell/ghcup-setup@v1
with:
stack-hook: true
- run: |
ghcup install stack
- 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