Skip to content

Commit e7a356a

Browse files
authored
ci: add cargo audit (#47)
- add cargo audit
1 parent 2bd79d7 commit e7a356a

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/security.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,46 @@ jobs:
3333
- uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2.3.9
3434
env:
3535
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
cargo-audit:
38+
name: cargo-audit
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
44+
45+
- name: Setup Rust
46+
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # stable
47+
with:
48+
toolchain: stable
49+
50+
- name: Restore cache
51+
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
52+
with:
53+
path: |
54+
~/.cargo/bin/
55+
~/.cargo/registry/index/
56+
~/.cargo/registry/cache/
57+
~/.cargo/git/db/
58+
key: cargo-audit-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }}
59+
restore-keys: |
60+
cargo-audit-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
61+
cargo-audit-${{ runner.os }}-
62+
63+
- name: Install cargo-audit
64+
run: cargo install cargo-audit --locked || true
65+
66+
- name: Run cargo audit
67+
run: cargo audit
68+
69+
- name: Save cache
70+
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
71+
if: always()
72+
with:
73+
path: |
74+
~/.cargo/bin/
75+
~/.cargo/registry/index/
76+
~/.cargo/registry/cache/
77+
~/.cargo/git/db/
78+
key: cargo-audit-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }}

0 commit comments

Comments
 (0)