1
0
Fork 0
mirror of https://github.com/malob/prefmanager.git synced 2024-12-14 11:57:49 +00:00

Add improved Nix CI workflow

This commit is contained in:
Malo Bourgon 2023-06-28 16:25:16 -07:00
parent a7404783f8
commit c8caff143a

53
.github/workflows/nix.yml vendored Normal file
View file

@ -0,0 +1,53 @@
name: Nix CI
on:
pull_request:
push:
jobs:
matrix:
name: Generate matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.gen-matrix.outputs.matrix }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Genrate matrix
id: gen-matrix
run: |
echo "matrix=$(nix eval --impure --json --expr '(import ./constants.nix).ghcVersions')" \
>> $GITHUB_OUTPUT
build:
needs: matrix
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
ghc: ${{ fromJson(needs.matrix.outputs.matrix) }}
name: Nix build (${{ matrix.ghc }})
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Setup cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build and test
run: |
NAME=$(nix eval --impure --raw --expr '(import ./constants.nix).name')-${{ matrix.ghc }}
nix -L build .#$NAME
nix run .#$NAME -- domains