2023-06-29 00:27:16 +00:00
|
|
|
name: CI
|
|
|
|
|
2020-10-08 19:37:59 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
2023-06-29 00:27:16 +00:00
|
|
|
|
2020-10-08 19:37:59 +00:00
|
|
|
jobs:
|
2023-06-29 00:27:16 +00:00
|
|
|
matrix:
|
|
|
|
name: Generate matrix
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.gen-matrix.outputs.matrix }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2024-03-25 19:13:21 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-06-29 00:27:16 +00:00
|
|
|
|
|
|
|
- name: Install Nix
|
2024-03-25 19:13:21 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@v10
|
2023-06-29 00:27:16 +00:00
|
|
|
|
|
|
|
- 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
|
2021-01-14 01:13:58 +00:00
|
|
|
runs-on: macos-latest
|
2023-06-29 00:27:16 +00:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
ghc: ${{ fromJson(needs.matrix.outputs.matrix) }}
|
|
|
|
|
|
|
|
name: Nix build (${{ matrix.ghc }})
|
|
|
|
|
2020-10-08 19:37:59 +00:00
|
|
|
steps:
|
2023-06-29 00:27:16 +00:00
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Install Nix
|
2024-03-25 19:13:21 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@v10
|
2023-06-29 00:27:16 +00:00
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2023-06-29 00:38:10 +00:00
|
|
|
nix-build-devshell:
|
|
|
|
name: Nix build devshell
|
|
|
|
runs-on: macos-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2024-03-25 19:13:21 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-06-29 00:38:10 +00:00
|
|
|
|
|
|
|
- name: Install Nix
|
2024-03-25 19:13:21 +00:00
|
|
|
uses: DeterminateSystems/nix-installer-action@v10
|
2023-06-29 00:38:10 +00:00
|
|
|
|
|
|
|
- name: Setup cache
|
|
|
|
uses: DeterminateSystems/magic-nix-cache-action@main
|
|
|
|
|
|
|
|
- name: Build and test
|
|
|
|
run: |
|
|
|
|
nix -L develop . --command echo "OK"
|
|
|
|
|
2023-06-29 00:27:16 +00:00
|
|
|
stack-build:
|
|
|
|
name: Stack build
|
|
|
|
runs-on: macos-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2024-03-25 19:13:21 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-06-29 00:27:16 +00:00
|
|
|
|
|
|
|
- name: Build and test
|
|
|
|
run: |
|
|
|
|
stack run -- domains
|