super-productivity/.github/workflows
Johannes Millan e72aa77336
Add Electron packaging smoke test to catch missing dependencies (#7336)
* ci(electron): verify packaged app.asar and smoke-test launch

Adds coverage for the gap that let #7320 ship: CI built electron TS
and ran electron-builder on release, but never exercised the packaged
binary. A stray relative import reaching out of electron/** was
compiled by tsc into src/app/util/*.js, fell outside the files glob
in electron-builder.yaml, and was missing from app.asar — the main
process crashed on launch for every 18.2.7 user.

Two new checks, both running on ubuntu-latest:

1. tools/verify-electron-requires.js extracts app.asar and re-resolves
   every relative require() under electron/** against the packaged
   tree. Runs on every PR that touches electron/**, electron-builder
   config, package.json, or the workflow itself. ~10s after the build.

2. A launch-under-xvfb smoke test starts the packaged binary, waits
   30s for a crash, and greps stderr for 'Cannot find module' /
   'Uncaught Exception'. Runs on push to master, release tags, and
   manual dispatch (not every PR — needs xvfb setup + idle wait).

Exposed as npm run electron:verify-asar for local use after dist.

* ci(electron): harden smoke workflow and verify script from review

Review feedback on the previous commit surfaced a handful of real
defects. Addressed here:

verify-electron-requires.js
- Guard resolved paths against escaping the extracted asar tree.
  Without this, a relative require with enough `..` climbs above the
  temp dir and Node's resolver hits the host filesystem, masking a
  genuinely missing module behind a stray file on the CI runner.
- Walk .cjs and .mjs files too. electron/simple-store.test.cjs ships
  via the `electron/**/*` glob and was being skipped.
- Move cleanup out of the path where `process.exit(1)` runs inside a
  `try/finally` (synchronous exit does not guarantee `finally`), so
  the temp dir is reliably removed.
- Code comment noting that esbuild-bundled preload.js is opaque to
  this walker — that coverage comes from the launch smoke test.

electron-smoke.yml
- Broaden pull_request paths filter. The previous filter only matched
  electron/**, which is exactly the wrong answer: #7320's root cause
  was a file under src/app/util/ that electron/ imported. Now uses a
  negative list — docs, translations, android/, ios/, other workflows.
- Explicit Xvfb screen geometry (`-screen 0 1280x720x24`) and
  `--disable-dev-shm-usage` on the Electron side. Both known CI
  flake preventers.
- Expanded crash-marker regex: SIGSEGV, Segmentation fault,
  TypeError:, ReferenceError:, FATAL ERROR, Check failed. Also scan
  the log during the liveness loop, not just at the end — catches
  main-process exceptions that get logged without killing the
  process.
- Move the launch log under .tmp/smoke/ so upload-artifact@v7 reliably
  finds it on failure; /tmp paths are fragile across runner images.
- Sweep stray electron worker processes on teardown via pkill.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-23 21:53:28 +02:00
..
auto-publish-google-play-on-release.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
build-android.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
build-create-windows-store-on-release.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
build-ios.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
build-publish-to-aur-on-release.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
build-publish-to-mac-store-on-release.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
build-publish-to-snap-on-release.yml security: pin all GitHub Actions to commit SHAs (CVE-2025-30066 mitigation) 2026-01-21 14:30:24 +01:00
build-update-web-app-on-release.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
build.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
ci.yml ci(electron): wire node --test for electron/*.test.cjs 2026-04-21 21:50:52 +02:00
claude.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
codeql-analysis.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
e2e-scheduled.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
electron-smoke.yml Add Electron packaging smoke test to catch missing dependencies (#7336) 2026-04-23 21:53:28 +02:00
issue-open-auto-reply.yml fix(ci): add issues write permission to autoresponse workflow 2026-01-06 13:17:15 +01:00
manual-build.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
pr-preview-build.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
pr-preview-deploy.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
publish-to-hub-docker.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
stale-discussions.yml chore(deps)(deps): bump the github-actions-minor group with 7 updates (#7150) 2026-04-09 20:34:50 +02:00
stale.yml chore(deps)(deps): bump the github-actions-minor group with 5 updates (#6610) 2026-02-23 13:16:42 +01:00
supersync-docker.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
test-mac-dmg-build.yml chore(deps)(deps): bump the github-actions-minor group across 1 directory with 8 updates (#7289) 2026-04-20 13:41:16 +02:00
welcome-first-time-contributors.yml fix(ci): replace buggy first-interaction action with custom first-time check 2026-02-13 14:06:43 +01:00
wiki-sync.yml docs(ci): prevent sync job from running on PR (#6240) 2026-01-28 16:39:54 +01:00