From ca8338da90ad24d6b1b1f7229c255865161926c5 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sat, 31 Jan 2026 18:39:56 +0000 Subject: [PATCH] Add Gitea Actions workflow: ci.yml --- .gitea/workflows/ci.yml | 77 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 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..facac4f --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,77 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: actions/setup-rust@v1 + with: + rust-version: '1.75' + toolchain: stable + + - name: Cache cargo registry + uses: actions/cache@v4 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-registry- + + - name: Cache cargo build + uses: actions/cache@v4 + with: + path: target + key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-build- + + - name: Check format + run: cargo fmt --check --all + + - name: Check clippy + run: cargo clippy --all-features --all-targets -- -D warnings + + - name: Build + run: cargo build --all-features + + - name: Run tests + run: cargo test --lib + + - name: Run integration tests + run: cargo test --test integration_test + + - name: Run all tests + run: cargo test + + release: + needs: test + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: actions/setup-rust@v1 + with: + rust-version: '1.75' + toolchain: stable + + - name: Build release + run: cargo build --release --locked + + - name: Create Release + uses: https://gitea.com/actions/release-action@main + with: + files: | + target/release/lata + title: ${{ github.ref_name }} + body: Release ${{ github.ref_name }}