gitscope
← rgit / Diff · 6da5324 → 6da5324
Changes 6da5324..6da5324
Patch commit
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e147f96..99e637d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,67 +3,32 @@ on: [push, pull_request]
name: CI
jobs:
- check:
- name: Check
+ nix-matrix:
runs-on: ubuntu-latest
+ outputs:
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- - uses: actions/checkout@v3
- - uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: stable
- override: true
- - uses: actions-rs/cargo@v1
- with:
- command: check
-
- # TODO: the build for this started failing in 1b34a74891423e118c567368c95b7e04f3b9ca63
- #test:
- # name: Test Suite
- # runs-on: ubuntu-latest
- # steps:
- # - uses: actions/checkout@v2
- # - uses: actions-rs/toolchain@v1
- # with:
- # profile: minimal
- # toolchain: stable
- # override: true
- # - uses: actions-rs/cargo@v1
- # with:
- # command: test
+ - uses: actions/checkout@v4
+ - uses: cachix/install-nix-action@v30
+ - id: set-matrix
+ name: Generate Nix Matrix
+ run: |
+ set -Eeu
+ matrix="$(nix eval --json '.#githubActions.matrix')"
+ echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
- fmt:
- name: Rustfmt
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: stable
- override: true
- - run: rustup component add rustfmt
- - uses: actions-rs/cargo@v1
- with:
- command: fmt
-
- cargo-deny:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - uses: EmbarkStudios/cargo-deny-action@v1
-
- clippy:
- name: Clippy
- runs-on: ubuntu-latest
+ check:
+ name: ${{ matrix.name }} (${{ matrix.system }})
+ needs: nix-matrix
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- - uses: actions/checkout@v3
- - uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: stable
- override: true
- - run: rustup component add clippy
- - uses: actions-rs/cargo@v1
+ - uses: actions/checkout@v4
+ - uses: cachix/install-nix-action@v30
+ - name: Authenticate with Cachix
+ uses: cachix/cachix-action@v15
with:
- command: clippy
+ name: rgit
+ authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
+ - run: nix build -L '.#${{ matrix.attr }}'
diff --git a/flake.lock b/flake.lock
index 4822a91..dbf5152 100644
--- a/flake.lock
+++ b/flake.lock
@@ -47,6 +47,26 @@
"type": "github"
}
},
+ "nix-github-actions": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1731952509,
+ "narHash": "sha256-p4gB3Rhw8R6Ak4eMl8pqjCPOLCZRqaehZxdZ/mbFClM=",
+ "owner": "nix-community",
+ "repo": "nix-github-actions",
+ "rev": "7b5f051df789b6b20d259924d349a9ba3319b226",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "nix-github-actions",
+ "type": "github"
+ }
+ },
"nixpkgs": {
"locked": {
"lastModified": 1727731257,
@@ -84,6 +104,7 @@
"advisory-db": "advisory-db",
"crane": "crane",
"helix": "helix",
+ "nix-github-actions": "nix-github-actions",
"nixpkgs": "nixpkgs",
"treefmt-nix": "treefmt-nix",
"utils": "utils"
diff --git a/flake.nix b/flake.nix
index 0b2c313..196e052 100644
--- a/flake.nix
+++ b/flake.nix
@@ -15,9 +15,20 @@
url = "github:JordanForks/helix";
flake = false;
};
+
+ nix-github-actions = {
+ url = "github:nix-community/nix-github-actions";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
};
- outputs = { self, nixpkgs, utils, crane, advisory-db, treefmt-nix, helix }:
+ outputs = { self, nixpkgs, utils, crane, advisory-db, treefmt-nix, helix, nix-github-actions }:
+ {
+ githubActions = nix-github-actions.lib.mkGithubMatrix {
+ checks = { inherit (self.checks) x86_64-linux x86_64-darwin aarch64-darwin; };
+ };
+ }
+ //
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
@@ -57,11 +68,11 @@
in
{
checks = {
- inherit rgit;
- rgit-clippy = craneLib.cargoClippy buildArgs;
- rgit-doc = craneLib.cargoDoc buildArgs;
- rgit-audit = craneLib.cargoAudit { inherit advisory-db; src = cargoOnlySrc; };
- rgit-test = craneLib.cargoNextest (buildArgs // {
+ build = rgit;
+ clippy = craneLib.cargoClippy buildArgs;
+ doc = craneLib.cargoDoc buildArgs;
+ audit = craneLib.cargoAudit { inherit advisory-db; src = cargoOnlySrc; };
+ test = craneLib.cargoNextest (buildArgs // {
partitions = 1;
partitionType = "count";
});