From 042a1c5df9659124ca4e321509d21a853abdafc3 Mon Sep 17 00:00:00 2001 From: mookachaka Date: Sat, 29 Aug 2026 05:09:10 -0400 Subject: [PATCH 1/2] ci: add security CI workflow (clippy, fmt, tests, cargo-audit, cargo-geiger) --- .github/workflows/ci-security.yml | 71 +++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/ci-security.yml diff --git a/.github/workflows/ci-security.yml b/.github/workflows/ci-security.yml new file mode 100644 index 0000000..a194049 --- /dev/null +++ b/.github/workflows/ci-security.yml @@ -0,0 +1,71 @@ +name: CI — security & quality + +on: + push: + branches: + - main + - Init + - 'feature/**' + pull_request: + workflow_dispatch: + +jobs: + checks: + runs-on: ubuntu-latest + strategy: + matrix: + task: [fmt, clippy, test, audit, geiger] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: clippy, rustfmt, rust-src + + - name: Cache cargo registry & target + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Ensure lockfile + run: cargo generate-lockfile + + - name: Check formatting + if: matrix.task == 'fmt' + run: cargo fmt --all -- --check + + - name: Run clippy (deny warnings) + if: matrix.task == 'clippy' + run: cargo clippy --all-targets --all-features -- -D warnings + + - name: Run tests + if: matrix.task == 'test' + run: cargo test --all --no-fail-fast + + - name: Install cargo-audit + if: matrix.task == 'audit' + run: cargo install --locked cargo-audit || true + + - name: Run cargo-audit + if: matrix.task == 'audit' + run: cargo audit + + - name: Install cargo-geiger + if: matrix.task == 'geiger' + run: cargo install --locked cargo-geiger || true + + - name: Run cargo-geiger + if: matrix.task == 'geiger' + run: cargo geiger --all-targets --all-features From 19cfab212201f14b1a43f7c7296fb96d1ef91dae Mon Sep 17 00:00:00 2001 From: mookachaka Date: Sat, 29 Aug 2026 05:31:51 -0400 Subject: [PATCH 2/2] ci: add pinned-action workflow (cargo-audit, cargo-geiger) --- .github/workflows/ci-security-pinned.yml | 67 ++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/ci-security-pinned.yml diff --git a/.github/workflows/ci-security-pinned.yml b/.github/workflows/ci-security-pinned.yml new file mode 100644 index 0000000..fcae960 --- /dev/null +++ b/.github/workflows/ci-security-pinned.yml @@ -0,0 +1,67 @@ +name: CI — pinned security & quality + +on: + push: + branches: + - main + - Init + - 'feature/**' + pull_request: + workflow_dispatch: + +jobs: + checks: + runs-on: ubuntu-latest + strategy: + matrix: + task: [fmt, clippy, test, audit, geiger] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + components: clippy, rustfmt, rust-src + + - name: Cache cargo registry & target + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Ensure lockfile + run: cargo generate-lockfile + + - name: Check formatting + if: matrix.task == 'fmt' + run: cargo fmt --all -- --check + + - name: Run clippy (deny warnings) + if: matrix.task == 'clippy' + run: cargo clippy --all-targets --all-features -- -D warnings + + - name: Run tests + if: matrix.task == 'test' + run: cargo test --all --no-fail-fast + + - name: Run cargo-audit (action wrapper) + if: matrix.task == 'audit' + uses: rustsec/cargo-audit-action@v1 + with: + args: '--deny advisories' + + - name: Run cargo-geiger (action wrapper) + if: matrix.task == 'geiger' + uses: jonas-schievink/cargo-geiger-action@v1 + with: + args: '--all-targets --all-features'