# CI that runs on pull requests and pushes to master.
name: CI
on:
  push:
    branches:
      - master
  pull_request:
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
jobs:
  stack-test:
    name: stack test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: ./.github/actions/stack-test

  flake-check:
    name: flake check and push
    if: github.event_name == 'push'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: cachix/install-nix-action@v31
      - uses: DeterminateSystems/magic-nix-cache-action@v13
      - uses: cachix/cachix-action@v17
      - run: nix build
      - run: nix flake check
