From 04fddc7017d4ce38f9c875fb5a3ebaeeac5963e7 Mon Sep 17 00:00:00 2001 From: Dariusz Koryto Date: Thu, 15 Oct 2026 03:22:54 +0200 Subject: [PATCH] ci: run regression tests, type checks and the web build on pull requests (#569) The full non-E2E suite (`bun run test`) only ran inside the release workflow, and pull requests only built the Docker image, so a failing test or type error surfaced at release time. A new Test workflow runs on every pull request and push to main (Markdown and docs-only changes excluded): - "Type check and build": `bun run typecheck`, `bun run typecheck:mobile` and `bun run build:web`; - "Regression tests": `bun run test` (bulk and integration suites). It uses the Bun version pinned in package.json, retries `bun install` like the other workflows, cancels superseded runs, reads the repository only, and is limited to this repository so deployment forks spend no runners. --- .github/workflows/test.yml | 91 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..7542853f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,91 @@ +name: Test + +# Runs the non-E2E regression suite, type checks and the web build for every +# pull request and every push to main, so failures surface before a release +# instead of in the release workflow. +on: + pull_request: + paths-ignore: + - "**/*.md" + - "docs/**" + push: + branches: + - main + paths-ignore: + - "**/*.md" + - "docs/**" + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: edgeever-test-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + checks: + # Forks that deploy their own copy do not spend runners on this; pull + # requests opened against this repository still run here. + if: github.repository == 'tianma-if/edgeever' + name: Type check and build + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Set up Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version-file: package.json + + - name: Install dependencies + run: | + for attempt in 1 2 3; do + if bun install --frozen-lockfile; then + exit 0 + fi + if [[ "$attempt" = "3" ]]; then + exit 1 + fi + sleep "$((15 * attempt))" + done + + - name: Type check + run: bun run typecheck + + - name: Type check mobile + run: bun run typecheck:mobile + + - name: Build web + run: bun run build:web + + tests: + if: github.repository == 'tianma-if/edgeever' + name: Regression tests + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Set up Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version-file: package.json + + - name: Install dependencies + run: | + for attempt in 1 2 3; do + if bun install --frozen-lockfile; then + exit 0 + fi + if [[ "$attempt" = "3" ]]; then + exit 1 + fi + sleep "$((15 * attempt))" + done + + - name: Run regression tests + run: bun run test