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:
parent
a7404783f8
commit
c8caff143a
1 changed files with 53 additions and 0 deletions
53
.github/workflows/nix.yml
vendored
Normal file
53
.github/workflows/nix.yml
vendored
Normal 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
|
||||
|
Loading…
Reference in a new issue