Skip to content

Commit c81f75d

Browse files
committed
ci: add basic workflow
1 parent 838bcf2 commit c81f75d

File tree

4 files changed

+67
-17
lines changed

4 files changed

+67
-17
lines changed

.github/workflows/check.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Nix Flake actions
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
nix-matrix:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
matrix: ${{ steps.set-matrix.outputs.matrix }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: cachix/install-nix-action@v30
17+
- id: set-matrix
18+
name: Generate Nix Matrix
19+
run: |
20+
set -Eeu
21+
matrix="$(nix eval --json '.#githubActions.matrix')"
22+
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
23+
24+
nix-build:
25+
name: ${{ matrix.name }} (${{ matrix.system }})
26+
needs: nix-matrix
27+
runs-on: ${{ matrix.os }}
28+
strategy:
29+
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: cachix/install-nix-action@v30
33+
- uses: cachix/cachix-action@v15
34+
with:
35+
name: kidibox
36+
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
37+
- run: nix build -L '.#${{ matrix.attr }}'

flake.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
3434
pre-commit-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
3535

36+
nix-github-actions.url = "github:nix-community/nix-github-actions";
37+
nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
38+
3639
stylix = {
3740
url = "github:danth/stylix";
3841
inputs = {
@@ -72,7 +75,7 @@
7275

7376
outputs =
7477
inputs@{ self, ... }:
75-
inputs.snowfall-lib.mkFlake {
78+
(inputs.snowfall-lib.mkFlake {
7679
inherit self inputs;
7780

7881
src = ./.;
@@ -94,5 +97,10 @@
9497
outputs-builder = channels: {
9598
formatter = inputs.treefmt-nix.lib.mkWrapper channels.nixpkgs ./treefmt.nix;
9699
};
100+
})
101+
// {
102+
githubActions = inputs.nix-github-actions.lib.mkGithubMatrix {
103+
checks = inputs.nixpkgs.lib.getAttrs [ "x86_64-linux" "x86_64-darwin" ] self.checks;
104+
};
97105
};
98106
}

0 commit comments

Comments
 (0)