From 4d337064af5db7ca7950afaecd14ba936e5a5745 Mon Sep 17 00:00:00 2001 From: "s0wlz (Matthias Puchstein)" Date: Wed, 29 Apr 2026 04:22:43 +0200 Subject: [PATCH] feat(ci): add Gitea Actions test workflow --- .gitea/workflows/test.yml | 80 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..18cc54a --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,80 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + + - uses: pnpm/action-setup@v4 + with: + version: latest + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: '1.95.0' + + - name: Cache Cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + backend/target + key: cargo-${{ hashFiles('backend/Cargo.lock') }} + restore-keys: cargo- + + - name: Cache pnpm store + uses: actions/cache@v4 + with: + path: ~/.local/share/pnpm/store + key: pnpm-${{ hashFiles('frontend/pnpm-lock.yaml') }} + restore-keys: pnpm- + + - name: Install frontend deps + run: pnpm --dir frontend install --frozen-lockfile + + - name: Install Playwright browsers + run: pnpm --dir frontend exec playwright install --with-deps chromium + + - name: Type check (backend) + run: cargo check --manifest-path backend/Cargo.toml + + - name: Type check (frontend) + run: pnpm --dir frontend exec tsgo --version && pnpm --dir frontend check + + - name: Unit tests (backend) + run: cargo test --manifest-path backend/Cargo.toml + + - name: Build frontend + run: pnpm --dir frontend build + + - name: E2E tests + env: + TT_TEST_PORT_RANDOM: '1' + run: | + make test-up + pnpm --dir frontend test:e2e + + - name: Stop test backend + if: always() + run: make test-down || true + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: playwright-results + path: | + frontend/test-results/ + frontend/playwright-report/ + retention-days: 7