From cbafec8b5ecf51407b6eca86887550c44231b6d7 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Wed, 4 Feb 2026 15:48:28 +0000 Subject: [PATCH] fix: add Rust/Cargo CI workflow for gitpulse project --- .gitea/workflows/ci.yml | 74 ++++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 30 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 18ff8c7..a19f24d 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,54 +2,68 @@ name: CI on: push: - branches: [main, master] + branches: [main] pull_request: - branches: [main, master] + branches: [main] jobs: - test: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Setup Rust - uses: actions/setup-rust@v1 + - name: Install Rust + uses: actions-rs/toolchain@v1 with: - rust-version: '1.70' - cache: true + toolchain: stable + profile: minimal + override: true - - name: Build + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libgit2-dev pkg-config + + - name: Build project run: cargo build --release - name: Run tests - run: cargo test + run: cargo test --all - - name: Check formatting - run: cargo fmt -- --check - - - name: Clippy - run: cargo clippy --all-targets --all-features -- -D warnings - - release: - needs: test - if: startsWith(github.ref, 'refs/tags/v') + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Setup Rust - uses: actions/setup-rust@v1 + - name: Install Rust + uses: actions-rs/toolchain@v1 with: - rust-version: '1.70' - cache: true + toolchain: stable + profile: minimal + override: true - - name: Build release - run: cargo build --release + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libgit2-dev pkg-config - - name: Create Release - uses: https://gitea.com/actions/release-action@main + - name: Run clippy + uses: actions-rs/cargo@v1 with: - files: | - target/release/gitpulse - name: ${{ github.ref_name }} - body: "Release ${{ github.ref_name }}" + command: clippy + args: --all-features -- -D warnings + + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Check formatting + run: cargo fmt --all -- --check