fix(ci): add retry for macOS tests + reduce workers to 2
- Add 3-attempt retry loop for macOS test job (flaky vitest worker crashes) - Reduce CI workers to 2 on macOS (same as Windows) to reduce resource pressure - All tests pass, workers just crash unexpectedly at end of run
This commit is contained in:
parent
8c282d8fa6
commit
35e83a378b
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@ -344,7 +344,16 @@ jobs:
|
|||||||
- name: Run ${{ matrix.task }}
|
- name: Run ${{ matrix.task }}
|
||||||
env:
|
env:
|
||||||
NODE_OPTIONS: --max-old-space-size=4096
|
NODE_OPTIONS: --max-old-space-size=4096
|
||||||
run: ${{ matrix.command }}
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
for attempt in 1 2 3; do
|
||||||
|
if ${{ matrix.command }}; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "Test run failed (attempt $attempt/3). Retrying (flaky vitest worker crash)…"
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
|
|
||||||
macos-app:
|
macos-app:
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
|
|||||||
@ -6,8 +6,10 @@ import { defineConfig } from "vitest/config";
|
|||||||
const repoRoot = path.dirname(fileURLToPath(import.meta.url));
|
const repoRoot = path.dirname(fileURLToPath(import.meta.url));
|
||||||
const isCI = process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true";
|
const isCI = process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true";
|
||||||
const isWindows = process.platform === "win32";
|
const isWindows = process.platform === "win32";
|
||||||
|
const isMacOS = process.platform === "darwin";
|
||||||
const localWorkers = Math.max(4, Math.min(16, os.cpus().length));
|
const localWorkers = Math.max(4, Math.min(16, os.cpus().length));
|
||||||
const ciWorkers = isWindows ? 2 : 3;
|
// Cap CI workers: Windows/macOS get 2 (flaky worker crashes), Linux gets 3
|
||||||
|
const ciWorkers = isWindows || isMacOS ? 2 : 3;
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user