forked from lix-project/nix-eval-jobs
ed136e1396
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 16 to 17. - [Release notes](https://github.com/cachix/install-nix-action/releases) - [Commits](https://github.com/cachix/install-nix-action/compare/v16...v17) --- updated-dependencies: - dependency-name: cachix/install-nix-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
name: "Flake checks"
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
|
|
flake-checks:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
# Nix Flakes doesn't work on shallow clones
|
|
fetch-depth: 0
|
|
- uses: cachix/install-nix-action@v17
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
- id: set-matrix
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
matrix="$(nix flake show --json | jq '.checks."x86_64-linux" | keys' | jq -rcM '{attr: ., os: ["ubuntu-latest", "macos-latest"]}')"
|
|
echo "::set-output name=matrix::$matrix"
|
|
|
|
builds:
|
|
needs: flake-checks
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix: ${{fromJSON(needs.flake-checks.outputs.matrix)}}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
# Nix Flakes doesn't work on shallow clones
|
|
fetch-depth: 0
|
|
- uses: cachix/install-nix-action@v17
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
- run: |
|
|
set -euo pipefail
|
|
|
|
system=$(nix-instantiate --eval --expr builtins.currentSystem | jq -r)
|
|
nix build -L .#checks.$system.${{ matrix.attr }}
|