From ca5c792ed7642a75528e0b3954567e4eec145df5 Mon Sep 17 00:00:00 2001 From: Markus <66058642+mhovd@users.noreply.github.com> Date: Wed, 25 Mar 2026 10:19:03 +0100 Subject: [PATCH 1/3] ci: Update CI Runs Lint only on Ubuntu, saving minutes. Uses a consistent cache. Runs security-audits bi-weekly. --- .github/workflows/rust.yml | 57 ++++++++++++++-------------- .github/workflows/security_audit.yml | 12 ++---- 2 files changed, 33 insertions(+), 36 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 719f6125f..26ac98926 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,7 +2,7 @@ permissions: contents: read name: Build -'on': +"on": push: branches: - main @@ -11,17 +11,32 @@ name: Build - main concurrency: - group: '${{ github.workflow }}-${{ github.ref }}' + group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true env: CARGO_TERM_COLOR: always jobs: - + lint: + runs-on: ubuntu-latest + name: Lint + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - name: Check formatting + run: cargo fmt --all -- --check + test: - runs-on: '${{ matrix.os }}' - name: '${{ matrix.os }} / stable' + needs: lint + runs-on: "${{ matrix.os }}" + name: "${{ matrix.os }} / stable" strategy: fail-fast: false matrix: @@ -32,41 +47,27 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v6 - + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt, clippy - + - name: Setup cache - uses: actions/cache@v5 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Check formatting - run: cargo fmt --all -- --check - + uses: Swatinem/rust-cache@v2 + - name: Build (no features) run: cargo build --verbose --no-default-features - + - name: Build (default features) run: cargo build --verbose - + - name: Build (all features) run: cargo build --verbose --all-features - + - name: Run tests (no features) run: cargo test --verbose --no-default-features - + - name: Run tests (default features) run: cargo test --verbose - + - name: Run tests (all features) run: cargo test --verbose --all-features - - - name: Run doc tests - run: cargo test --doc --all-features diff --git a/.github/workflows/security_audit.yml b/.github/workflows/security_audit.yml index 1a897c632..aa5446326 100644 --- a/.github/workflows/security_audit.yml +++ b/.github/workflows/security_audit.yml @@ -1,7 +1,9 @@ name: Security Audit -'on': +"on": workflow_dispatch: + schedule: + - cron: "0 6 1,15 * *" permissions: contents: read @@ -13,13 +15,7 @@ jobs: - name: Checkout code uses: actions/checkout@v6 - name: Setup cache - uses: actions/cache@v5 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + uses: Swatinem/rust-cache@v2 - name: Install cargo-audit run: cargo install cargo-audit - name: Run security audit From 84471a0a4682bb24341c7ab5ad3123765a85bb61 Mon Sep 17 00:00:00 2001 From: Markus <66058642+mhovd@users.noreply.github.com> Date: Wed, 25 Mar 2026 10:21:00 +0100 Subject: [PATCH 2/3] Update security_audit.yml Use binary of cargo audit instead of compiling from source --- .github/workflows/security_audit.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/security_audit.yml b/.github/workflows/security_audit.yml index aa5446326..0b104d83b 100644 --- a/.github/workflows/security_audit.yml +++ b/.github/workflows/security_audit.yml @@ -14,9 +14,7 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v6 - - name: Setup cache - uses: Swatinem/rust-cache@v2 - - name: Install cargo-audit - run: cargo install cargo-audit - - name: Run security audit - run: cargo audit + - name: Security audit + uses: rustsec/audit-check@v2.0.2 + with: + token: ${{ secrets.GITHUB_TOKEN }} From 8465f07704593d2ccd15e54454e0befcc785b3f4 Mon Sep 17 00:00:00 2001 From: Markus <66058642+mhovd@users.noreply.github.com> Date: Wed, 25 Mar 2026 10:23:00 +0100 Subject: [PATCH 3/3] Fix version --- .github/workflows/security_audit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/security_audit.yml b/.github/workflows/security_audit.yml index 0b104d83b..0779933fa 100644 --- a/.github/workflows/security_audit.yml +++ b/.github/workflows/security_audit.yml @@ -15,6 +15,6 @@ jobs: - name: Checkout code uses: actions/checkout@v6 - name: Security audit - uses: rustsec/audit-check@v2.0.2 + uses: rustsec/audit-check@v2 with: token: ${{ secrets.GITHUB_TOKEN }}