chore(ci): extract reusable e2e/test workflows + release pretest gate#1887
Conversation
Split the desktop E2E and test pipelines into `workflow_call` reusable workflows (`e2e-reusable.yml`, `test-reusable.yml`) so the same recipe runs on PR/push and at release time without duplication. PR/push runs Linux-only smoke E2E (required) plus the existing unit + rust suites. Both release workflows (`release-staging.yml`, `release-production.yml`) now gate `build-desktop`/`build-docker` on a single `pretest-tests` + `pretest-e2e` pass across all three target OSes with the full spec suite — no signed bundles get built unless unit, rust, and E2E are all green on the build ref. `cleanup-failed-*` was extended to tear down the just-pushed tag when pretest fails (release-production additionally guards the release-delete + Docker-cleanup steps so they're skipped when there is nothing to clean up). Caching covers pnpm store, Swatinem rust target dirs (root + tauri), CEF runtime download (keyed to match build-desktop.yml so a release build and an E2E run on the same commit share a single download), Appium global install, and sccache for Rust tests.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThis PR adds reusable GitHub Actions for tests and E2E, updates main test/E2E workflows to delegate to those reusables, and introduces pretest gates in production and staging release workflows that must pass before builds/releases proceed. ChangesWorkflow reusability and pretest gates
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/test-reusable.yml (1)
92-95: 💤 Low valueConsider adding
timeout-minutestounit-testsandrust-tauri-testsjobs.The
rust-core-testsjob specifiestimeout-minutes: 20, but the other two jobs lack timeouts. Adding consistent timeouts prevents runaway jobs from consuming resources indefinitely.🔧 Suggested diff for rust-tauri-tests
rust-tauri-tests: if: inputs.run_rust_tauri name: Rust Tauri Shell Tests runs-on: ubuntu-22.04 + timeout-minutes: 20 container:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/test-reusable.yml around lines 92 - 95, The unit-tests and rust-tauri-tests jobs are missing job-level timeouts; add a timeout-minutes setting (match the rust-core-tests value, e.g., timeout-minutes: 20) inside each job definition for "unit-tests" and "rust-tauri-tests" so the GitHub Actions runner will cancel runaway jobs; update the YAML under the job keys unit-tests and rust-tauri-tests to include timeout-minutes: 20.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/e2e-reusable.yml:
- Around line 296-322: Add a Windows cache step after the "Cache CEF binary
distribution" step to persist the Appium/npm global install so the subsequent
"Install Appium and chromium driver" step doesn't reinstall each run: use
actions/cache@v5 and cache the Windows npm global and cache directories (e.g.,
paths under %APPDATA%\npm and %USERPROFILE%\.npm or the equivalent runner
variables) with a key that includes the runner OS and a repo manifest hash
(similar to the existing CEF/Appium caches) and appropriate restore-keys so the
"Install Appium and chromium driver" block can rely on the restored cache.
In @.github/workflows/release-production.yml:
- Around line 308-320: The pretest jobs are checking out the wrong commit
because test-reusable.yml and e2e-reusable.yml lack a ref input and their
actions/checkout@v5 steps don't use a ref; add an inputs.ref parameter to both
reusable workflows, update their checkout steps to use ref: ${{ inputs.ref }},
and then update the pretest job invocations (pretest-tests and pretest-e2e) to
pass the produced build_ref via with: ref: ${{
needs.prepare-build.outputs.build_ref }} so the reusable workflows check out the
exact tag/SHA from prepare-build.
---
Nitpick comments:
In @.github/workflows/test-reusable.yml:
- Around line 92-95: The unit-tests and rust-tauri-tests jobs are missing
job-level timeouts; add a timeout-minutes setting (match the rust-core-tests
value, e.g., timeout-minutes: 20) inside each job definition for "unit-tests"
and "rust-tauri-tests" so the GitHub Actions runner will cancel runaway jobs;
update the YAML under the job keys unit-tests and rust-tauri-tests to include
timeout-minutes: 20.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0d0851e7-ccb0-4619-8b42-6e0cdd5bc31e
📒 Files selected for processing (6)
.github/workflows/e2e-reusable.yml.github/workflows/e2e.yml.github/workflows/release-production.yml.github/workflows/release-staging.yml.github/workflows/test-reusable.yml.github/workflows/test.yml
Address CodeRabbit review on PR tinyhumansai#1887: - Add a `ref` input to `test-reusable.yml` and `e2e-reusable.yml` and wire it through every `actions/checkout@v5` step in those workflows. Previously the pretest gate ran on whatever ref happened to trigger the release workflow (main HEAD), not the bumped commit the build matrix would actually consume. After this, both release workflows pass `needs.prepare-build.outputs.build_ref` (the freshly-pushed staging / production tag) so pretest validates byte-for-byte what build-desktop will check out. - Add the missing Appium global-install cache step to the Windows e2e job, matching the Linux and macOS jobs.
Summary
e2e.ymlandtest.ymlintoworkflow_callreusables (e2e-reusable.yml,test-reusable.yml) so PR/push and release runs share one recipe.workflow_dispatch.build-desktop/build-dockeron apretest-tests+pretest-e2epass across all three target OSes with the full spec suite — no signed bundles get built unless every unit/rust/E2E suite is green on the build ref.build-desktop.ymlso a release build and an E2E run on the same SHA share one ~400MB download), Appium global install, sccache for Rust tests.cleanup-failed-stagingandcleanup-failed-releasewere extended to also tear down the just-pushed tag when pretest fails; release-production additionally guards the release-delete and Docker-cleanup steps so they're skipped when there's nothing to clean up.Problem
The previous setup ran the E2E recipe inline inside
e2e.yml(3 near-identical jobs) and bolted the test pipeline onto every PR viatest.yml. The two release workflows then startedbuild-desktopimmediately afterprepare-build, with no test gate at all — a busted commit onmaincould produce four signed Tauri bundles + a staging tag + (on production) a draft GH Release before anyone noticed unit tests failed.That meant:
e2e.ymlduplicated across three jobs, painful to evolve.build-desktop.yml.Solution
Split the recipe into two reusable workflows and have both PR/push runs and release runs call them, with different inputs:
e2e-reusable.ymlwithrun_linux: trueonly andfull: false(smoke + mega-flow). Test-reusable runs the existing unit/rust matrix. Both required.pretest-tests+pretest-e2ejob betweenprepare-buildand the build matrix, calling the reusables with all three platforms andfull: true.build-desktop/build-docker/create-releaseonly proceed if pretest is green.cef-<target>-<hashFiles(Cargo.toml)>) intentionally mirror the keys inbuild-desktop.ymlso warm caches survive across workflows on the same commit.The
workflow_dispatchform ofe2e.ymlkeeps the existing "run the full suite on demand" escape hatch via opt-in checkboxes for macOS/Windows/full.Submission Checklist
Impact
continue-on-error: true); flaky CEF/Xvfb runs will fail PRs instead of being silently informational. If the container CEF flake returns, re-addcontinue-on-error: trueon thee2e-linuxjob ine2e-reusable.yml.build-desktop.ymlshould cut CEF download time to zero on release runs after the first warm hit per Cargo.toml change.Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
chore/reusable-ci-workflowsValidation Run
pnpm --filter openhuman-app format:check(ran via pre-push hook, green)pnpm typecheck(ran via pre-push hook, green)yaml.safe_loadon all six filescargo check --manifest-path Cargo.tomlandapp/src-tauri/Cargo.toml, both greenValidation Blocked
Behavior Changes
pretest-testsandpretest-e2ejobs in release-staging / release-production runs.Parity Contract
test.yml+e2e.ymlLinux smoke + mega-flow. macOS/Windows E2E remain dispatch-only on PR runs.cleanup-failed-*extended for the new pretest-failure path (deletes orphaned tag; guards the release-delete and Docker-cleanup steps so they're skipped when nothing was created).Duplicate / Superseded PR Handling
Summary by CodeRabbit