mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-02-14 20:05:48 +01:00
58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
name: check and push
|
|
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@v4
|
|
- uses: haskell/ghcup-setup@v1
|
|
id: ghcup
|
|
with:
|
|
stack-hook: true
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
${{ steps.ghcup.outputs.basedir }}
|
|
~/.stack
|
|
key: stack-${{ runner.os }}-${{ hashFiles('stack.yaml') }}
|
|
restore-keys: |
|
|
stack-${{ runner.os }}-
|
|
${{ runner.os }}-
|
|
- 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@v15
|
|
with:
|
|
name: stackage-infrastructure
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
- run: nix build
|
|
- run: nix flake check
|