From cd603b93ff20bbf7a8d0038cc50393a833e149a0 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Wed, 4 Feb 2026 04:39:42 +0000 Subject: [PATCH] Add Gitea Actions workflow: ci.yml --- .gitea/workflows/ci.yml | 87 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..a9db157 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,87 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check + + - name: Run cargo clippy + uses: actions-rs/cargo@v1 + with: + command: Clippy + args: -- -D warnings + + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: Test + args: --all -- --nocapture + + - name: Upload coverage + uses: codecov/codecov-action@v3 + with: + files: ./target/debug/coverage.tar.gz + fail_ci_if_error: false + + build: + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@v4 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Build release + uses: actions-rs/cargo@v1 + with: + command: Build + args: --release + + - name: Upload binary + uses: actions/upload-artifact@v3 + with: + name: gitignore-gen + path: target/release/gitignore-gen + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Check formatting + run: cargo fmt --check --all + + - name: Check clippy + run: cargo clippy --all-targets --all-features -- -D warnings