Skip to content

Commit da0ecf6

Browse files
oschwaldclaude
andcommitted
Add security scanning and modernize GitHub Actions
- Add CodeQL workflow for Rust security vulnerability scanning - Add cargo-audit workflow for dependency CVE checking - Replace deprecated actions-rs/toolchain with dtolnay/rust-toolchain - Replace actions-rs/cargo with direct cargo commands 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent bd45717 commit da0ecf6

File tree

4 files changed

+61
-33
lines changed

4 files changed

+61
-33
lines changed

.github/workflows/audit.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Security Audit
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
schedule:
8+
- cron: "0 0 * * *" # Daily at midnight
9+
10+
jobs:
11+
audit:
12+
name: Cargo Audit
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v6
17+
18+
- name: Run cargo-audit
19+
uses: rustsec/audit-check@v2
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/codeql.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
schedule:
9+
- cron: "0 6 * * 1" # Weekly on Monday
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write
17+
actions: read
18+
contents: read
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v6
23+
24+
- name: Initialize CodeQL
25+
uses: github/codeql-action/init@v3
26+
with:
27+
languages: rust
28+
29+
- name: Perform CodeQL Analysis
30+
uses: github/codeql-action/analyze@v3

.github/workflows/doc.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,10 @@ jobs:
1515
uses: actions/checkout@v6
1616

1717
- name: Install Rust toolchain
18-
uses: actions-rs/toolchain@v1
19-
with:
20-
toolchain: stable
21-
profile: minimal
22-
override: true
18+
uses: dtolnay/rust-toolchain@stable
2319

2420
- name: Build Documentation
25-
uses: actions-rs/cargo@v1
26-
with:
27-
command: doc
28-
args: --all --no-deps
21+
run: cargo doc --all --no-deps
2922

3023
- name: Create index
3124
run: echo '<meta http-equiv=refresh content=0;url=maxminddb/index.html>' > target/doc/index.html

.github/workflows/rust.yml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,14 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v6
23+
2324
- name: Install ${{ matrix.toolchain }} toolchain
24-
uses: actions-rs/toolchain@v1
25+
uses: dtolnay/rust-toolchain@master
2526
with:
26-
profile: minimal
2727
toolchain: ${{ matrix.toolchain }}
28-
override: true
2928

3029
- name: Run cargo check
31-
uses: actions-rs/cargo@v1
32-
with:
33-
command: check
30+
run: cargo check
3431

3532
test:
3633
name: Test Suite
@@ -46,16 +43,12 @@ jobs:
4643
submodules: true
4744

4845
- name: Install ${{ matrix.toolchain }} toolchain
49-
uses: actions-rs/toolchain@v1
46+
uses: dtolnay/rust-toolchain@master
5047
with:
51-
profile: minimal
5248
toolchain: ${{ matrix.toolchain }}
53-
override: true
5449

5550
- name: Run cargo test
56-
uses: actions-rs/cargo@v1
57-
with:
58-
command: test
51+
run: cargo test
5952

6053
lints:
6154
name: Lints
@@ -65,21 +58,12 @@ jobs:
6558
uses: actions/checkout@v6
6659

6760
- name: Install stable toolchain
68-
uses: actions-rs/toolchain@v1
61+
uses: dtolnay/rust-toolchain@stable
6962
with:
70-
profile: minimal
71-
toolchain: stable
72-
override: true
7363
components: rustfmt, clippy
7464

7565
- name: Run cargo fmt
76-
uses: actions-rs/cargo@v1
77-
with:
78-
command: fmt
79-
args: --all -- --check
66+
run: cargo fmt --all -- --check
8067

8168
- name: Run cargo clippy
82-
uses: actions-rs/cargo@v1
83-
with:
84-
command: clippy
85-
args: -- -D warnings
69+
run: cargo clippy -- -D warnings

0 commit comments

Comments
 (0)