From 5985c548c05b5dfebfede6f456f8a025742d4f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9E=97=E4=BC=9F?= Date: Thu, 23 Apr 2026 23:02:59 +0800 Subject: [PATCH] feat: add GitHub CI and fix clippy too-many-arguments --- .github/workflows/ci.yaml | 47 +++++++++++++++++++++++++++++++++++++++ src/commands/send.rs | 1 + 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..87d8701 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,47 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + + - name: Run cargo check + run: cargo check + + test: + name: Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + + - name: Run cargo test + run: cargo test + + lints: + name: Lints + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + + - name: Install rustfmt and clippy + run: rustup component add rustfmt clippy + + - name: Run cargo fmt + run: cargo fmt --all --check + + - name: Run cargo clippy + run: cargo clippy --all-features -- -D warnings diff --git a/src/commands/send.rs b/src/commands/send.rs index 0ecf593..e7ef19d 100644 --- a/src/commands/send.rs +++ b/src/commands/send.rs @@ -9,6 +9,7 @@ use crate::{ wechat::media::{OutboundMediaKind, build_media_item, upload_media}, }; +#[allow(clippy::too_many_arguments)] pub async fn run( account: Option, user_id: Option<&str>,