Skip to content

Commit e05099e

Browse files
prebuild android to help with timeouts
1 parent 074a617 commit e05099e

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/test-simulators.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,18 @@ jobs:
119119
- name: Install dependencies
120120
run: pnpm install
121121

122+
- name: Build
123+
run: pnpm build:packages
124+
122125
- name: Install Capacitor example dependencies
123126
working-directory: ./packages/capacitor/example-app
124127
run: pnpm install
125128

126-
- name: Build
127-
run: pnpm build:packages
129+
- name: Build Capacitor Android app
130+
working-directory: ./packages/capacitor/example-app
131+
env:
132+
CAPACITOR_VITEST_SERVER_URL: http://${{ env.TEST_SERVER_HOST }}
133+
run: pnpm exec cap build android
128134

129135
- name: Run Capacitor Android browser tests
130136
uses: reactivecircus/android-emulator-runner@v2.28.0

packages/capacitor/vitest.config.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class CapacitorBrowserProvider implements BrowserProvider {
7777
async openPage(_sessionId: string, url: string, _options?: { parallel: boolean }) {
7878
const serverUrl = serverUrlForPlatform(url);
7979

80-
// Ensure the target app spawning webviews is up-to-date.
80+
// Ensure the target app spawning webviews is up-to-date with the current Vitest server URL.
8181
const buildResult = spawnSync('npx', ['cap', 'sync'], {
8282
stdio: 'inherit',
8383
cwd: EXAMPLE_APP_DIR,
@@ -89,8 +89,7 @@ class CapacitorBrowserProvider implements BrowserProvider {
8989
if (buildResult.status !== 0) {
9090
throw new Error(`cap sync failed with exit code ${buildResult.status}`);
9191
}
92-
// TODO, support other platforms
93-
const app = spawn('npx', ['cap', 'run', environment.platform, '--target', environment.target], {
92+
const app = spawn('npx', ['cap', 'run', environment.platform, '--target', environment.target, '--no-sync'], {
9493
cwd: EXAMPLE_APP_DIR,
9594
env: {
9695
...process.env,

0 commit comments

Comments
 (0)