ci: run the browser E2E suite and require every job in the aggregate
This commit is contained in:
1 parent
6c3b34f73e
commit
6c86c4e559
12 files changed
+331
-39
No files matched your search
+67
-27
@@ -101,7 +101,7 @@ jobs:
|
||||
run: make -C backend test-race
|
||||
|
||||
integration:
|
||||
name: Integration tests (${{ matrix.shard }}/2)
|
||||
name: Integration tests (${{ matrix.shard }}/${{ strategy.job-total }})
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
@@ -121,10 +121,12 @@ jobs:
|
||||
cache-dependency-path: backend/go.sum
|
||||
- name: Install Go dependencies
|
||||
run: make -C backend deps
|
||||
# The shard total comes from the matrix size, so adding a shard cannot
|
||||
# leave TEST_SHARD_TOTAL stale; an index outside the total fails the run.
|
||||
- name: Run PostgreSQL, Redis, SeaweedFS, and Kafka integration shard
|
||||
env:
|
||||
TEST_SHARD_INDEX: ${{ matrix.shard }}
|
||||
TEST_SHARD_TOTAL: "2"
|
||||
TEST_SHARD_TOTAL: ${{ strategy.job-total }}
|
||||
GOFLAGS: -race
|
||||
run: make -C backend test-int
|
||||
|
||||
@@ -316,6 +318,55 @@ jobs:
|
||||
- name: Build and check technical health routes
|
||||
run: make -C deploy smoke
|
||||
|
||||
e2e:
|
||||
name: Browser E2E
|
||||
needs:
|
||||
- backend
|
||||
- frontend
|
||||
- infrastructure
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- name: Check out source
|
||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
||||
with:
|
||||
node-version-file: frontend/.node-version
|
||||
- name: Install declared pnpm
|
||||
run: npm install --global "$(node -p "require('./frontend/package.json').packageManager")"
|
||||
- name: Cache pnpm store
|
||||
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: ~/.local/share/pnpm/store
|
||||
key: ${{ runner.os }}-pnpm-${{ hashFiles('frontend/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-
|
||||
# The runner mounts the installed @playwright/test into the browser image.
|
||||
- name: Install frontend dependencies
|
||||
run: make -C frontend install
|
||||
# deploy/scripts/e2e.sh generates its own throwaway env file with random
|
||||
# secrets outside the workspace and starts a fresh, uniquely named stand,
|
||||
# so the job needs no repository secrets and no root .env.
|
||||
- name: Run the Playwright suite on an isolated stand
|
||||
run: make -C deploy test-e2e
|
||||
# Only the Playwright report, failed-test traces and screenshots, and the
|
||||
# stand logs are uploaded; the generated env file never enters this tree.
|
||||
- name: Upload E2E diagnostics
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: e2e-diagnostics-attempt-${{ github.run_attempt }}
|
||||
path: |
|
||||
frontend/test-results/e2e/report/
|
||||
frontend/test-results/e2e/results/
|
||||
frontend/test-results/e2e/stand.log
|
||||
if-no-files-found: warn
|
||||
include-hidden-files: false
|
||||
retention-days: 14
|
||||
|
||||
aggregate:
|
||||
name: Required CI result
|
||||
if: always()
|
||||
@@ -328,35 +379,24 @@ jobs:
|
||||
- codegen
|
||||
- infrastructure
|
||||
- smoke
|
||||
- e2e
|
||||
- security
|
||||
- security-images
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
# Every job in needs must report success. failure, cancelled, and
|
||||
# skipped (for example after a failed dependency) all fail this result,
|
||||
# and a job added to needs is checked without a separate line here.
|
||||
- name: Require every CI job to pass
|
||||
env:
|
||||
API_RESULT: ${{ needs.api.result }}
|
||||
BACKEND_RESULT: ${{ needs.backend.result }}
|
||||
INTEGRATION_RESULT: ${{ needs.integration.result }}
|
||||
FRONTEND_RESULT: ${{ needs.frontend.result }}
|
||||
ML_RESULT: ${{ needs.ml.result }}
|
||||
CODEGEN_RESULT: ${{ needs.codegen.result }}
|
||||
INFRASTRUCTURE_RESULT: ${{ needs.infrastructure.result }}
|
||||
SMOKE_RESULT: ${{ needs.smoke.result }}
|
||||
SECURITY_RESULT: ${{ needs.security.result }}
|
||||
SECURITY_IMAGES_RESULT: ${{ needs.security-images.result }}
|
||||
NEEDS_JSON: ${{ toJSON(needs) }}
|
||||
run: |
|
||||
printf 'api=%s backend=%s frontend=%s ml=%s codegen=%s infrastructure=%s smoke=%s\n' \
|
||||
"$API_RESULT" "$BACKEND_RESULT" "$FRONTEND_RESULT" "$ML_RESULT" \
|
||||
"$CODEGEN_RESULT" "$INFRASTRUCTURE_RESULT" "$SMOKE_RESULT"
|
||||
test "$API_RESULT" = success
|
||||
test "$BACKEND_RESULT" = success
|
||||
printf 'integration=%s\n' "$INTEGRATION_RESULT"
|
||||
test "$INTEGRATION_RESULT" = success
|
||||
test "$FRONTEND_RESULT" = success
|
||||
test "$ML_RESULT" = success
|
||||
test "$CODEGEN_RESULT" = success
|
||||
test "$INFRASTRUCTURE_RESULT" = success
|
||||
test "$SMOKE_RESULT" = success
|
||||
printf 'security=%s security-images=%s\n' "$SECURITY_RESULT" "$SECURITY_IMAGES_RESULT"
|
||||
test "$SECURITY_RESULT" = success
|
||||
test "$SECURITY_IMAGES_RESULT" = success
|
||||
set -euo pipefail
|
||||
jq -r 'to_entries[] | "\(.key)=\(.value.result)"' <<<"$NEEDS_JSON"
|
||||
test "$(jq 'length' <<<"$NEEDS_JSON")" -gt 0
|
||||
failed=$(jq -r '[to_entries[] | select(.value.result != "success") | .key] | join(" ")' <<<"$NEEDS_JSON")
|
||||
if [ -n "$failed" ]; then
|
||||
printf 'Required jobs did not succeed: %s\n' "$failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
@@ -40,6 +40,7 @@ jobs:
|
||||
needs:
|
||||
- docs
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Require documentation checks to pass
|
||||
env:
|
||||
|
||||
Reference in new issue
Block a user