From cdabef8d48011a0055cbec10606850036b9bbad7 Mon Sep 17 00:00:00 2001 From: Aaron Gorodetzky Date: Thu, 16 Oct 2025 20:01:13 -0400 Subject: [PATCH] Add some workflows --- .github/workflows/audit.yml | 16 ++++++++ .github/workflows/general.yml | 73 +++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 .github/workflows/audit.yml create mode 100644 .github/workflows/general.yml diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml new file mode 100644 index 0000000..0a980ce --- /dev/null +++ b/.github/workflows/audit.yml @@ -0,0 +1,16 @@ +name: Security audit +on: + schedule: + - cron: '0 0 * * *' + push: + paths: + - '**/Cargo.toml' + - '**/Cargo.lock' +jobs: + security_audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: taiki-e/install-action@cargo-deny + - name: Scan for vulnerabilities + run: cargo deny check advisories diff --git a/.github/workflows/general.yml b/.github/workflows/general.yml new file mode 100644 index 0000000..5059347 --- /dev/null +++ b/.github/workflows/general.yml @@ -0,0 +1,73 @@ +name: Rust + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + branches: + - main + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Install the Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Run tests + run: cargo test + + # `fmt` container job + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install the Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + - name: Enforce formatting + run: cargo fmt --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install the Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: clippy + - name: Linting + run: cargo clippy -- -D warnings + + # `coverage` container job + coverage: + name: Code coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install the Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: llvm-tools-preview + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Generate code coverage + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + - name: Generate report + run: cargo llvm-cov report --html --output-dir coverage + - uses: actions/upload-artifact@v4 + with: + name: "Coverage report" + path: coverage/