From b0e606d2ab1f01cf1cf986eb2f7f70828270ab07 Mon Sep 17 00:00:00 2001 From: VeryBaaad Date: Wed, 8 Apr 2026 22:41:24 +0800 Subject: [PATCH 1/2] ci: add Clippy and test workflows --- .github/workflows/check.yml | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..b495e20 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,69 @@ +name: Check + +on: + push: + pull_request: + +jobs: + clippy: + name: Clippy (${{ matrix.name }}) + runs-on: ${{ matrix.os }} + permissions: + contents: read + strategy: + fail-fast: false + matrix: + include: + - name: Windows + os: windows-latest + target: x86_64-pc-windows-msvc + - name: Linux + os: ubuntu-latest + target: x86_64-unknown-linux-gnu + - name: macOS + os: macos-14 + target: aarch64-apple-darwin + + steps: + - uses: actions/checkout@v4 + + - name: Setup Rust toolchain + run: | + rustup toolchain install + rustup target add ${{ matrix.target }} + + - name: Cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: "true" + cache-all-crates: "true" + + - name: Clippy + run: | + cd mmover + cargo clippy --all-targets --all-features --workspace \ + --target ${{ matrix.target }} -- \ + -D warnings + + tests: + name: Tests + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + + - name: Setup Rust toolchain + run: rustup toolchain install + + - name: Cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: "true" + cache-all-crates: "true" + + - name: Run tests + run: | + cd mmover + cargo test --all From 7f52074451aab51b133747fbac6880967f51390b Mon Sep 17 00:00:00 2001 From: VeryBaaad Date: Wed, 8 Apr 2026 22:45:30 +0800 Subject: [PATCH 2/2] fix(ci): use single-line cargo to fix pwsh error --- .github/workflows/check.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b495e20..6fa0d49 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -41,9 +41,7 @@ jobs: - name: Clippy run: | cd mmover - cargo clippy --all-targets --all-features --workspace \ - --target ${{ matrix.target }} -- \ - -D warnings + cargo clippy --all-targets --all-features --workspace --target ${{ matrix.target }} -- -D warnings tests: name: Tests