From e640ae17e5b7268eed3958fd4bbafac09106d2e5 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 4 Nov 2026 11:16:36 +0100 Subject: [PATCH] chore: add ci --- .gitea/workflows/ci.yaml | 82 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .gitea/workflows/ci.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..07274b7 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,82 @@ +name: CI +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + frontend: + name: Frontend + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Type check + run: npx tsc --noEmit + + - name: Prettier check + run: npm run format # make sure this is `prettier --check .` + + - name: Build frontend + run: npm run build + + rust: + name: Rust (Tauri backend) + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential curl wget file pkg-config \ + libwebkit2gtk-4.1-dev libxdo-dev libssl-dev \ + libayatana-appindicator3-dev librsvg2-dev + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Install dependencies + run: npm ci + + # Tauri's build script checks that frontendDist exists + - name: Build frontend + run: npm run build + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: src-tauri + + - name: Format check + run: cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check + + - name: Clippy + run: cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings + + - name: Test + run: cargo test --manifest-path src-tauri/Cargo.toml \ No newline at end of file