Skip to content

Commit

Permalink
ci: add audit check in check.yml (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulic-youthlic authored Feb 6, 2025
1 parent 35b6c29 commit 1c03f3e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,22 @@ jobs:
- name: Check test
run: |
nix build .#checks.x86_64-linux.test 2>&1
check-audit:
runs-on: ubuntu-latest
needs: build-nixpkg
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Nix
uses: nixbuild/nix-quick-install-action@v27

- name: Restore Nix Cache
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.nix') }}

- name: Check test
run: |
nix build .#checks.x86_64-linux.audit 2>&1
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
flake-utils = {
url = "github:numtide/flake-utils";
};
advisory-db = {
url = "github:rustsec/advisory-db";
flake = false;
};
};

outputs =
Expand All @@ -21,6 +25,7 @@
nixpkgs,
rust-overlay,
crane,
advisory-db,
...
}:
flake-utils.lib.eachDefaultSystem (
Expand Down Expand Up @@ -115,6 +120,12 @@
};
checks = {
inherit (self.packages."${system}") mania;
audit = craneLib.cargoAudit (
commonArgs
// {
inherit advisory-db;
}
);
clippy = craneLib.cargoClippy (
commonArgs
// {
Expand Down

0 comments on commit 1c03f3e

Please sign in to comment.