From 39a9247f99546d68c74eab3c1771703dcf6e24cb Mon Sep 17 00:00:00 2001 From: strawberries Date: Wed, 3 Jun 2026 15:22:20 +0200 Subject: [PATCH] added basic rust CI --- .gitea/workflows/rust.yml | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .gitea/workflows/rust.yml diff --git a/.gitea/workflows/rust.yml b/.gitea/workflows/rust.yml new file mode 100644 index 0000000..7635aae --- /dev/null +++ b/.gitea/workflows/rust.yml @@ -0,0 +1,45 @@ +on: [push, pull_request] +name: Rust lint and build + +jobs: + ci: + name: Rust CI + runs-on: ubuntu-latest + env: + RUNNER_TOOL_CACHE: /toolcache + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure Cargo Cache + uses: actions/cache@v5 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Install Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt, clippy + + - name: Rustfmt + run: cargo fmt --all -- --check + + - name: Check + run: cargo check + + - name: Clippy + run: cargo clippy -- -D warnings + + - name: Test + run: cargo test + + - name: Build + run: cargo build