Repository navigation
feat(cli): write a GitHub Actions or GitLab CI/CD pipeline in e2e init - #1647
kacperkapusciak wants to merge 9 commits into
Conversation
🟢 e2e web: 91 passedAll 91 tests in 41 files
Tested by e2e 0.23.0 · 1m 2s · web · run artifacts |
🟢 e2e web agent: 33 passed34 agent steps · 26 replayed from cache · 20 model calls · 88.4k tokens (94% cached) · $0.0036 All 33 tests in 5 files
Tested by e2e 0.23.0 · 1m 25s · web · run artifacts |
There was a problem hiding this comment.
All reported issues were addressed across 17 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
🟢 e2e ios agent: 21 passed, 1 skipped25 agent steps · 11 replayed from cache · 68 model calls · 443.0k tokens (82% cached) · $0.0306 All 22 tests in 1 file
Tested by e2e 0.23.0 · 9m 25s · ios-simulator · run artifacts |
🟢 e2e android agent: 20 passed24 agent steps · 15 replayed from cache · 44 model calls · 258.9k tokens (86% cached) · $0.0154 All 20 tests in 1 file
Tested by e2e 0.23.0 · 6m 13s · android-emulator · run artifacts |
🟢 e2e ios: 55 passed, 1 skippedAll 56 tests in 7 files
Tested by e2e 0.23.0 · 6m 56s · ios-simulator · run artifacts |
🟢 e2e android: 57 passed, 1 skippedAll 58 tests in 7 files
Tested by e2e 0.23.0 · 8m 51s · android-emulator · run artifacts |
There was a problem hiding this comment.
All reported issues were addressed across 9 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
e2e init asks for a CI pipeline in a project with the web engine (--ci github-actions|gitlab|none). It writes one job for the project's package manager and Node version that installs Chromium, runs e2e run, and keeps the report, and names the secret or CI/CD variable for the model key. It never overwrites a pipeline file; beside an existing .gitlab-ci.yml it writes a file to include.
Exact GitLab stage names, a distinct job name beside an existing e2e job, loopback baseURL in an existing config, no writes through a symlinked .github or .gitlab, --ci none in the skill, gitlab in the telemetry comment, and the GitLab Node image's major version in the docs.
The GitHub Actions workflow and the GitLab job live in packages/e2e/templates/ci/ as complete pipelines for npm at the repository root, linted as they are. init loads them with the yaml package's Document API and edits a copy for the project's package manager, folders, Node version, secrets, and target, keeping the comments. The pinned actions now live only in the templates.
b3f72d7 to
de6bff7
Compare
okwasniewski
left a comment
There was a problem hiding this comment.
- We need to figure out if you use mobile, then we should output GitHub or GitLab Mobile CI/CD. And if you select web, then appropriate. We should also handle the case where you select two of those.
init writes one job per platform the config's targets run on: web targets in the web job, iOS and Android targets in their own jobs, which build the app, boot a simulator or an emulator, and install the app. Targets come from the new config, or from loading an existing one after the confirmation and the install. Expo and bare React Native apps get their build; any other app gets a step to replace. GitHub's mobile jobs follow e2e-inc/e2e-react-native's workflow; GitLab's run on self-managed runners.
…he Android CI job
There was a problem hiding this comment.
All reported issues were addressed across 26 files
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
View guided diff | Turn on auto-fix | Re-trigger cubic
Upload the emulator log from the GitLab Android job, count peer and optional engine dependencies, ask nothing for a new config with no engine, key caches on Bun's bun.lockb when that is the lockfile, and run the symlink test with a Windows junction.
There was a problem hiding this comment.
0 issues found across 6 files (changes from recent commits).
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
View guided diff | Turn on auto-fix | Re-trigger cubic
e2e initgets a CI step. In a project with the web or mobile engine it asks which CI service to set up, then writes one job for each platform the config's targets run on: web, iOS, and Android.web, running every targetiosand/orandroid--target <its targets>--ci github-actions|gitlab|noneanswers the question.--yesalone writes none, since a pipeline runs on the next push. The wizard preselects the service the repository points to: its remote, a.github/folder, or a.gitlab-ci.yml.initwrites, or from loading an existing one the waye2e rundoes (loadConfigModule, andresolvePlatform/targetNamefromconfig/targets.ts). The load happens after the user confirms and after the install, so the config never runs on a cancelled wizard and an example's engine is installed first. A config that still doesn't load falls back topackage.json: web engine only, one web job runs every target; mobile engine, no pipeline.e2e run --reporter list,junit. It runs every target that isn't iOS or Android, HTTP tests included.macos-26with a Release simulator build, the image's own iPhone 17 Pro on a pinned iOS runtime, andE2E_DEVICEset to its UDID;ubuntu-latestwith KVM, anx86_64release APK, and an API 36 emulator, with a system-image install that retries a download that drops or comes back empty.expo run:ios,expo prebuild+ Gradle, no prebuild whenandroid/is committed), bare React Native (xcodebuildonios/*.xcworkspace, through Bundler with aGemfile;android/gradlew), or a step that fails until replaced, whichinitnames.tagsto replace, as ondocs/ci/gitlab.mdx;initsays so, and asks fordevice: process.env.E2E_DEVICEwhen the config lacks it..nvmrcor.node-version, else 24. A project in a subfolder or a workspace member gets the file at the repository root, the install at the workspace root, and the jobs in the project folder.env; GitLab gets CI/CD variables on its own.initreads the gateway from the config's import and prints thegh secret setorglab variable setcommand.initnever overwrites a pipeline file. Beside an existing.gitlab-ci.ymlit writes.gitlab/e2e.gitlab-ci.ymland prints theinclude:to add, renaming the jobs with-runwhen the pipeline has one of their names and saying when itsstages:leave outtest. A workflow or pipeline that already runse2e rungets nothing. Nothing is written through a symlinked.githubor.gitlab.app.command(web job only), a subscription gateway or a loopback model endpoint, a build step to replace, GitLab mobile runners.packages/e2e/templates/ci/, each a complete pipeline for npm at the repository root and an Expo app, whichactionlintandglab ci lintaccept as is.initedits a copy with theyamlpackage's Document API (new runtime dependency, pure JS), keeping comments and formatting; a platform with no targets loses its job. For the template's own case the output equals the template byte for byte.tests/unit/init-ci.test.tsfails when they drift.e2e_init_completedgets aciproperty.flowchart TD A[web or mobile engine in package.json?] -- no --> N[no question] A -- yes --> B{e2e run already in a workflow or .gitlab-ci.yml?} B -- yes --> N B -- no --> C[ask, preselect from remote / .github / .gitlab-ci.yml] C --> D[confirm changes, install] D --> E[targets: new config, or load the existing one] E --> F[web job for non-phone targets, ios and android jobs for phone targets] F --> G[.github/workflows/e2e.yml, .gitlab-ci.yml, or .gitlab/e2e.gitlab-ci.yml to include]Verified
Ran it locally: yes. The built CLI wrote the pipelines into real repos, and each ran unedited on hosted runners:
site/,.nvmrcat the rootsite/package.json.gitlab-ci.yml.gitlab-ci.ymlviainclude:node:26actionlintandglab ci lintpass on every combination rendered: web only, mobile only, both, each build kind, npm/pnpm/Yarn/Bun, a subfolder, and a workspace member. The GitLab file for e2e-react-native passesglab ci linttoo.Two fresh-context reviews found issues, all fixed: the first nine in the web-only version, then eight in the mobile one (the config loaded before the install, so an example got no pipeline; the GitLab header lost with the web job; and smaller ones). cubic's findings are fixed or answered in their threads, and kdy1's suggestion to keep the pipelines as YAML templates is in.
Tracked in ENG-1084.