Skip to content

Commit 456c94a

Browse files
Copilotharsha-simhadriarraykahildebrandmw
authored
Enable CodeQL security analysis (#754)
## CodeQL Enablement - [x] Create CodeQL workflow configuration - [x] Configure CodeQL for Rust language - [x] Set up build steps for Rust workspace - [x] Set up CodeQL database initialization and analysis - [x] Integrate CodeQL into ci.yml - [x] Remove separate codeql.yml workflow file - [x] Add CodeQL job to ci.yml workflow - [x] Verify build commands work correctly - [x] Address review feedback - [x] Scope security-events:write permission to only the codeql job (least-privilege) - [x] Fix step indentation to match other jobs in the workflow - [x] Use --profile ci to match other jobs and avoid cache duplication - [x] Remove CodeQL from basics gate to avoid blocking expensive tests ## Summary CodeQL is now integrated into the CI workflow and runs in parallel with all other jobs. It is not part of the "basics" gate, which means: - Fast basic checks (clippy, fmt, etc.) complete in ~30 seconds and immediately unblock expensive tests - CodeQL runs in parallel with expensive tests (workspace tests, coverage, etc.) - Total CI time is not increased by CodeQL's ~8 minute runtime - CodeQL is still a required check for PRs - it just doesn't block other tests from starting The job follows least-privilege principles with scoped permissions and uses the ci profile for build caching consistency. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>CodeQL enablement</issue_title> > <issue_description>## Is your feature request related to a problem? Please describe. > Enable CodeQL checks > > </issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #751 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: harsha-simhadri <5590673+harsha-simhadri@users.noreply.github.com> Co-authored-by: arrayka <1551741+arrayka@users.noreply.github.com> Co-authored-by: hildebrandmw <24898651+hildebrandmw@users.noreply.github.com>
1 parent 16cbd93 commit 456c94a

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,37 @@ jobs:
125125
--no-deps \
126126
--config "$RUST_CONFIG"
127127
128+
codeql:
129+
name: CodeQL security analysis
130+
runs-on: ubuntu-latest
131+
permissions:
132+
contents: read
133+
security-events: write
134+
135+
steps:
136+
- name: Checkout repository
137+
uses: actions/checkout@v4
138+
139+
- name: Initialize CodeQL
140+
uses: github/codeql-action/init@v3
141+
with:
142+
languages: rust
143+
144+
- name: Install Rust ${{ env.rust_stable }}
145+
uses: dtolnay/rust-toolchain@stable
146+
with:
147+
toolchain: ${{ env.rust_stable }}
148+
149+
- uses: Swatinem/rust-cache@v2
150+
151+
- name: Build workspace
152+
run: cargo build --workspace --locked --profile ci
153+
154+
- name: Perform CodeQL Analysis
155+
uses: github/codeql-action/analyze@v3
156+
with:
157+
category: "/language:rust"
158+
128159
# TODO: Re-enable docs check later
129160
# docs:
130161
# name: docs

0 commit comments

Comments
 (0)