Skip to content

Commit b58dcd0

Browse files
committed
ci: reduce redundant runtime gates
1 parent e8d8c5d commit b58dcd0

4 files changed

Lines changed: 26 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ jobs:
229229
retention-days: 7
230230

231231
go-smoke-test-embedded-postgres:
232+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
232233
runs-on: depot-ubuntu-24.04-4
233234
timeout-minutes: 15
234235
needs: [goreleaser-snapshot]
@@ -335,6 +336,7 @@ jobs:
335336
node scripts/check-changeset-required.mjs --base "origin/${{ github.base_ref }}"
336337
337338
quickstart-smoke:
339+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
338340
runs-on: depot-ubuntu-24.04-4
339341
timeout-minutes: 20
340342
needs: [goreleaser-snapshot]
@@ -423,6 +425,7 @@ jobs:
423425
fi
424426
425427
node-e2e:
428+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
426429
runs-on: depot-ubuntu-24.04-4
427430
timeout-minutes: 15
428431
steps:
@@ -792,11 +795,17 @@ jobs:
792795
steps:
793796
- name: Check CI gate results
794797
env:
798+
IS_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
795799
NEEDS_JSON: ${{ toJson(needs) }}
796800
run: |
797801
node <<'NODE'
798802
const needs = JSON.parse(process.env.NEEDS_JSON);
799803
const allowedSkipped = new Set(["changeset-check"]);
804+
if (process.env.IS_PULL_REQUEST === "true") {
805+
allowedSkipped.add("go-smoke-test-embedded-postgres");
806+
allowedSkipped.add("quickstart-smoke");
807+
allowedSkipped.add("node-e2e");
808+
}
800809
const failed = Object.entries(needs).filter(([name, job]) => {
801810
if (job.result === "success") return false;
802811
if (job.result === "skipped" && allowedSkipped.has(name)) return false;

AGENTS.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ signaled and cleaned up directly.
131131
startup, then runs `go run .`. Direct `go run .` callers must sync the embed
132132
folders themselves or disable both embedded UI surfaces.
133133

134-
End-to-end tests are **opt-in locally** — they're not part of the
135-
default `run-many -t lint,typecheck,build,test` invocation because they
136-
boot real dev servers and need browsers installed:
134+
Checked-in demo end-to-end tests are **opt-in locally** and main-only in CI.
135+
They are not part of the default `run-many -t lint,typecheck,build,test`
136+
invocation because they boot real dev servers and need browsers installed:
137137

138138
```sh
139139
corepack pnpm exec playwright install
@@ -159,11 +159,12 @@ Use `corepack pnpm run journey` for deterministic CI-style proof of the
159159
fresh-app path. Use `corepack pnpm run cli -- ...` for manual browser or agent
160160
experiments against the same local package train.
161161

162-
In CI the dedicated `node-e2e` job (in `.github/workflows/ci.yml`) gates merges
163-
on the checked-in demo integrations. The separate `consumer-journey-e2e` job is
164-
the fresh-app quality gate: it consumes the current workflow's GoReleaser image
165-
and npm package artifacts instead of public Zitadel packages. Browsers are
166-
cached on the runner to reduce install cost.
162+
In CI the `consumer-journey-e2e` matrix is the required PR runtime gate: it
163+
consumes the current workflow's GoReleaser image and npm package artifacts
164+
instead of public Zitadel packages. The checked-in demo integrations
165+
(`node-e2e`), raw binary embedded-postgres smoke, and documented quick-start
166+
compose smoke run on pushes to `main` as release-surface confidence checks.
167+
Browsers are cached on the runner to reduce install cost.
167168

168169
## Testing Layers
169170

@@ -333,7 +334,7 @@ Standard commands are documented in root `AGENTS.md` → **Local Checks** and
333334

334335
- **Fast local checks:** `corepack pnpm run check`
335336
- **Full local checks:** `corepack pnpm run check -- --full`
336-
- **E2E:** `corepack pnpm nx run-many -t e2e -p @zitadel/demo-next-e2e,@zitadel/demo-nuxt-e2e`
337+
- **Demo E2E (manual/main-only):** `corepack pnpm run check -- --only node:e2e`
337338
- **Consumer journey E2E:** `corepack pnpm run journey`
338339

339340
### Running demo apps manually

docs/operations/env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copy to .env next to docker-compose.yaml (see docs/quick-start/index.md).
2-
# On PR CI, quickstart-smoke overrides NEXTGEN_IMAGE with the Goreleaser snapshot tag.
2+
# On main CI, quickstart-smoke overrides NEXTGEN_IMAGE with the Goreleaser snapshot tag.
33

44
NEXTGEN_IMAGE=ghcr.io/zitadel/nextgen:latest
55
NEXTGEN_PORT=8080

scripts/check.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ const phases = new Map([
1616
["release", phaseRelease],
1717
["journey", phaseJourney],
1818
]);
19-
const fullOrder = [...phases.keys()];
19+
const fullOrder = [...phases.keys()].filter((phase) => phase !== "node:e2e");
2020
const fastOrder = ["openapi", "go", "node"];
21+
const explicitOnlyPhases = [...phases.keys()].filter((phase) => !fullOrder.includes(phase));
2122

2223
const options = parseArgs(forwardedArgs());
2324
const selected = options.only ? [options.only] : options.full ? fullOrder : fastOrder;
@@ -84,8 +85,11 @@ function usage(error) {
8485
8586
Default is --fast.
8687
87-
Phases:
88+
Full phases:
8889
${fullOrder.join("\n ")}
90+
91+
Explicit-only phases:
92+
${explicitOnlyPhases.join("\n ")}
8993
`);
9094
process.exit(error ? 1 : 0);
9195
}

0 commit comments

Comments
 (0)