feat(ci): test out building packages in GHA
This commit is contained in:
parent
577fc9d9e3
commit
0f8ca4007a
|
@ -0,0 +1,33 @@
|
|||
name: Nix Flake actions
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
|
||||
jobs:
|
||||
nix-matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v24
|
||||
- id: set-matrix
|
||||
name: Generate Nix Matrix
|
||||
run: |
|
||||
set -Eeu
|
||||
matrix="$(nix eval --json '.#githubActions.matrix')"
|
||||
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
|
||||
|
||||
nix-build:
|
||||
needs: nix-matrix
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v24
|
||||
- run: nix build -L ".#${{ matrix.attr }}"
|
21
flake.lock
21
flake.lock
|
@ -21,6 +21,26 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-github-actions": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1703863825,
|
||||
"narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-github-actions",
|
||||
"rev": "5163432afc817cf8bd1f031418d1869e4c9d5547",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-github-actions",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1704161960,
|
||||
|
@ -40,6 +60,7 @@
|
|||
"root": {
|
||||
"inputs": {
|
||||
"fenix": "fenix",
|
||||
"nix-github-actions": "nix-github-actions",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"rust-manifest": "rust-manifest",
|
||||
"systems": "systems"
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
inputs.fenix.url = "github:nix-community/fenix";
|
||||
inputs.fenix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
inputs.nix-github-actions.url = "github:nix-community/nix-github-actions";
|
||||
inputs.nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
inputs.rust-manifest.url = "https://static.rust-lang.org/dist/2023-10-22/channel-rust-nightly.toml";
|
||||
inputs.rust-manifest.flake = false;
|
||||
|
||||
|
@ -15,6 +18,7 @@
|
|||
self,
|
||||
nixpkgs,
|
||||
fenix,
|
||||
nix-github-actions,
|
||||
systems,
|
||||
rust-manifest,
|
||||
}: let
|
||||
|
@ -29,5 +33,8 @@
|
|||
in {
|
||||
packages = eachSystem (system: packagesFn pkgs.${system});
|
||||
overlays.default = final: prev: packagesFn prev;
|
||||
githubActions = nix-github-actions.lib.mkGithubMatrix {
|
||||
checks = nixpkgs.lib.getAttrs [ "x86_64-linux" ] self.packages;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue