-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (63 loc) · 1.99 KB
/
codeql.yml
File metadata and controls
76 lines (63 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: CodeQL
# CodeQL analysis - runs on PRs, main branch pushes, and weekly schedule.
# Push to main is required for Security tab to show alerts from default branch.
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 3 * * 1" # Weekly, Mondays 03:00 UTC
permissions:
contents: read
security-events: write
jobs:
analyze:
name: Analyze (CodeQL via vx)
# Skip CodeQL for release commits (e.g., "chore: release v0.7.6") since
# they only bump version numbers and update changelogs.
if: >-
github.event_name != 'push' ||
!startsWith(github.event.head_commit.message, 'chore: release')
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_DIR: ${{ github.workspace }}/.cache/sccache
steps:
- uses: actions/checkout@v6
- name: Setup vx
uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: "false"
- name: Cache vx tools
uses: actions/cache@v5
with:
path: ~/.vx
key: ${{ runner.os }}-vx-codeql-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-vx-codeql-
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install sccache
uses: taiki-e/install-action@v2
with:
tool: sccache
- name: Cache sccache
uses: actions/cache@v5
with:
path: ${{ github.workspace }}/.cache/sccache
key: sccache-codeql-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
restore-keys: |
sccache-codeql-${{ runner.os }}-
sccache-codeql-
- name: Start sccache server
run: sccache --start-server || true
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: rust
- name: Build with cargo
run: cargo build --release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4