From 6a4eee88fceb8581ecc1df6872af45f7abb1758f Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Wed, 4 Feb 2026 04:54:15 +0000 Subject: [PATCH] fix: resolve CI rustfmt not installed error --- .gitea/workflows/ci.yml | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 2267b6d..979813a 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,29 +2,45 @@ name: CI on: push: - branches: [main] + branches: [ main, master ] pull_request: - branches: [main] + branches: [ main, master ] jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable with: - profile: minimal components: rustfmt, clippy - - run: cargo fmt --check - - run: cargo clippy -- -D warnings + + - name: Check rustfmt availability + working-directory: ./gitignore-gen + run: which rustfmt + + - name: Run Rust linting + working-directory: ./gitignore-gen + run: | + cargo fmt --check + cargo clippy --all-targets --all-features -- -D warnings test: runs-on: ubuntu-latest - needs: lint steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable with: - profile: minimal components: rustfmt - - run: cargo test --all + + - name: Build Rust project + working-directory: ./gitignore-gen + run: cargo build --all-targets + + - name: Run Rust tests + working-directory: ./gitignore-gen + run: cargo test