Skip to content

Commit 61f39dd

Browse files
ci: run smoke tests after build (#2434)
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 4703297 commit 61f39dd

2 files changed

Lines changed: 37 additions & 3 deletions

File tree

.github/workflows/code-release.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
include:
1818
- arch: arm64
19-
runner: macos-15-arm64
19+
runner: macos-15
2020
- arch: x64
2121
runner: macos-15-intel
2222
runs-on: ${{ matrix.runner }}
@@ -134,11 +134,34 @@ jobs:
134134
- name: Build native modules
135135
run: pnpm --filter code run build-native
136136

137-
- name: Publish with Electron Forge
137+
- name: Build release artifacts
138+
env:
139+
APP_VERSION: ${{ steps.version.outputs.version }}
140+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
141+
run: pnpm --filter code exec electron-forge publish --dry-run --arch=${{ matrix.arch }} --platform=darwin
142+
143+
- name: Install Playwright
144+
run: pnpm --filter code exec playwright install
145+
146+
- name: Smoke test packaged app
147+
env:
148+
CI: true
149+
E2E_APP_ARCH: ${{ matrix.arch }}
150+
run: pnpm --filter code exec playwright test --config=tests/e2e/playwright.config.ts tests/e2e/tests/smoke.spec.ts
151+
152+
- name: Upload Playwright report
153+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
154+
if: failure()
155+
with:
156+
name: release-playwright-report-macos-${{ matrix.arch }}
157+
path: apps/code/playwright-report/
158+
retention-days: 7
159+
160+
- name: Publish release artifacts
138161
env:
139162
APP_VERSION: ${{ steps.version.outputs.version }}
140163
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
141-
run: pnpm --filter code exec electron-forge publish --arch=${{ matrix.arch }} --platform=darwin
164+
run: pnpm --filter code exec electron-forge publish --from-dry-run
142165

143166
publish-windows:
144167
runs-on: windows-latest

apps/code/tests/e2e/fixtures/electron.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99

1010
function getAppPath(): string {
1111
const outDir = path.join(__dirname, "../../../out");
12+
const requestedArch = process.env.E2E_APP_ARCH;
1213

1314
if (process.platform === "darwin") {
1415
const arm64Path = path.join(
@@ -20,6 +21,16 @@ function getAppPath(): string {
2021
"PostHog Code-darwin-x64/PostHog Code.app/Contents/MacOS/PostHog Code",
2122
);
2223

24+
if (requestedArch === "arm64") {
25+
if (existsSync(arm64Path)) return arm64Path;
26+
throw new Error(`No darwin-arm64 packaged app found at ${arm64Path}.`);
27+
}
28+
29+
if (requestedArch === "x64") {
30+
if (existsSync(x64Path)) return x64Path;
31+
throw new Error(`No darwin-x64 packaged app found at ${x64Path}.`);
32+
}
33+
2334
if (existsSync(arm64Path)) return arm64Path;
2435
if (existsSync(x64Path)) return x64Path;
2536

0 commit comments

Comments
 (0)