1
0
Fork 0
mirror of https://github.com/malob/prefmanager.git synced 2024-12-14 11:57:49 +00:00
prefmanager/.github/workflows/ci.yml
2024-03-25 12:13:21 -07:00

82 lines
1.8 KiB
YAML

name: 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@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v10
- name: Genrate matrix
id: gen-matrix
run: |
echo "matrix=$(nix eval --impure --json --expr '(import ./constants.nix).ghcVersions')" \
>> $GITHUB_OUTPUT
nix-build-packages:
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@v10
- 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
nix-build-devshell:
name: Nix build devshell
runs-on: macos-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v10
- name: Setup cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build and test
run: |
nix -L develop . --command echo "OK"
stack-build:
name: Stack build
runs-on: macos-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Build and test
run: |
stack run -- domains