From f4ba9384b4b4e5ec12bb8b2f78c1476949198696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=B1=E7=89=B9=E6=AF=8F=E7=BE=8A=E9=98=9F?= Date: Fri, 5 Jun 2026 01:29:58 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=85=8D=E7=BD=AE=20CI=20=E4=B8=8E=20?= =?UTF-8?q?cargo-deny?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ deny.toml | 10 ++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 deny.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..54d8faf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + + - uses: Swatinem/rust-cache@v2 + + - name: Check formatting + run: cargo fmt --all -- --check + + - name: Clippy + run: cargo clippy --all-targets -- -D warnings + + - name: Build + run: cargo build --verbose + + - name: Test + run: cargo test --verbose diff --git a/deny.toml b/deny.toml new file mode 100644 index 0000000..ebdcbd8 --- /dev/null +++ b/deny.toml @@ -0,0 +1,10 @@ +[licenses] +allow = ["MIT", "Apache-2.0", "ISC", "BSD-2-Clause", "BSD-3-Clause"] +unlicensed = "deny" + +[bans] +multiple-versions = "warn" + +[advisories] +vulnerability = "deny" +unmaintained = "warn"