-
-
Notifications
You must be signed in to change notification settings - Fork 12
119 lines (107 loc) · 2.97 KB
/
test.yml
File metadata and controls
119 lines (107 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
concurrency:
group: tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
name: Lint and format check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.11"
- run: bun install --frozen-lockfile
- name: ESLint
run: bun run lint
- name: Prettier
run: bun run format:check
unit:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.11"
- run: bun install --frozen-lockfile
- run: bun run test
- run: bun run check:e2e:coverage
e2e-smoke:
name: E2E Smoke (${{ matrix.browser }})
needs: [lint, unit]
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
browser: [chrome, firefox]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.11"
- run: bun install --frozen-lockfile
- name: Install Firefox for Puppeteer
if: matrix.browser == 'firefox'
run: bunx puppeteer browsers install firefox
- name: Run smoke e2e (10s target, non-blocking runtime report)
env:
BROWSER: ${{ matrix.browser }}
CI: "true"
run: |
python - <<'PY'
import os
import subprocess
import sys
import time
browser = os.environ["BROWSER"]
budget_seconds = 10
start = time.time()
result = subprocess.run(["bun", "run", "test:e2e", f"--platform={browser}"], check=False)
elapsed = time.time() - start
print(f"smoke_elapsed_seconds={elapsed:.2f}")
if result.returncode != 0:
sys.exit(result.returncode)
if elapsed > budget_seconds:
print(f"::warning::Smoke e2e exceeded {budget_seconds}s target on {browser}: {elapsed:.2f}s")
PY
e2e-full:
name: E2E Full (${{ matrix.browser }})
needs: [e2e-smoke]
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
browser: [chrome, firefox]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.11"
- run: bun install --frozen-lockfile
- name: Install Firefox for Puppeteer
if: matrix.browser == 'firefox'
run: bunx puppeteer browsers install firefox
- run: bun run test:e2e:full --platform=${{ matrix.browser }}
env:
CI: "true"