From 0d3987f76e751abe053ae7c91cd8a0c200b4c116 Mon Sep 17 00:00:00 2001 From: Eric Ratliff Date: Sun, 22 Feb 2026 07:53:00 -0600 Subject: [PATCH] Set up a CI pipeline, but haven't tested it yet --- .gitea/workflows/ci.yml | 103 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 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..5fb3c7c --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,103 @@ +name: CI + +on: + workflow_dispatch: + push: + branches: [master, develop] + pull_request: + branches: [master] + +env: + CARGO_TERM_COLOR: always + +jobs: + test-linux: + name: Test (Linux) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo registry and build + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: linux-cargo-${{ hashFiles('Cargo.lock') }} + restore-keys: linux-cargo- + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose + + - name: Check for warnings + run: cargo build 2>&1 | grep -c "warning" | xargs test 0 -eq + + test-windows: + name: Test (Windows MSVC) + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo registry and build + uses: actions/cache@v4 + with: + path: | + ~\.cargo\registry + ~\.cargo\git + target + key: windows-cargo-${{ hashFiles('Cargo.lock') }} + restore-keys: windows-cargo- + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + components: clippy + + - name: Cache cargo registry and build + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: clippy-cargo-${{ hashFiles('Cargo.lock') }} + restore-keys: clippy-cargo- + + - name: Run clippy + run: cargo clippy -- -D warnings + + fmt: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - name: Check formatting + run: cargo fmt --check \ No newline at end of file