Run CI workflow on pull_request target to pick up forks #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CI" | |
on: | |
push: | |
branches: | |
- "**" | |
- "!main" | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
outputs: | |
configs: ${{ steps.list-configs.outputs.configs }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: determinatesystems/nix-installer-action@v4 | |
- name: nix flake check | |
run: | | |
nix flake check | |
- name: List NixOS configurations | |
id: list-configs | |
run: | |
echo "configs=$(nix flake show --json | jq -c '.nixosConfigurations | keys')" > $GITHUB_OUTPUT | |
build: | |
runs-on: ubuntu-latest | |
needs: | |
- check | |
strategy: | |
fail-fast: false | |
matrix: | |
system: ${{ fromJSON(needs.check.outputs.configs) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: determinatesystems/nix-installer-action@v4 | |
- uses: determinatesystems/magic-nix-cache-action@v2 | |
- env: | |
NIXOS_CONFIG: ${{ matrix.system }} | |
run: | | |
nix build ".#nixosConfigurations.$NIXOS_CONFIG.config.system.build.toplevel" | |