Skip to content

Commit b3d77d8

Browse files
committed
feat(ci): add lint step and Rust CodeQL support
- Add lint step to CI workflow (runs make lint before tests) - Install clang-format in CI for consistent formatting checks - Add Rust to CodeQL language matrix for security analysis - Add Rust toolchain and build steps for CodeQL Rust analysis
1 parent 6833433 commit b3d77d8

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ jobs:
3131

3232
- name: Setup Rust
3333
uses: dtolnay/rust-toolchain@stable
34+
with:
35+
components: clippy, rustfmt
36+
37+
- name: Install clang-format
38+
run: sudo apt-get install -y clang-format
39+
40+
- name: Lint
41+
run: make lint
3442

3543
- name: Run repository baseline
3644
run: make test

.github/workflows/codeql.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
language: ['cpp', 'go']
27+
language: ['cpp', 'go', 'rust']
2828

2929
steps:
3030
- name: Checkout code
@@ -44,6 +44,18 @@ jobs:
4444
cd ../../range/cpp && g++ -std=c++17 -O2 main.cpp -o rangecoder_cpp
4545
cd ../../rle/cpp && g++ -std=c++17 -O2 main.cpp -o rle_cpp
4646
47+
- name: Setup Rust (for Rust analysis)
48+
if: matrix.language == 'rust'
49+
uses: dtolnay/rust-toolchain@stable
50+
51+
- name: Build Rust (for Rust analysis)
52+
if: matrix.language == 'rust'
53+
run: |
54+
cargo build --manifest-path algorithms/huffman/rust/Cargo.toml --bin huffman_rust
55+
cargo build --manifest-path algorithms/arithmetic/rust/Cargo.toml --bin arithmetic_rust
56+
cargo build --manifest-path algorithms/range/rust/Cargo.toml
57+
cargo build --manifest-path algorithms/rle/rust/Cargo.toml --bin rle_rust
58+
4759
- name: Perform CodeQL Analysis
4860
uses: github/codeql-action/analyze@v3
4961
with:

0 commit comments

Comments
 (0)