-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (76 loc) · 2.7 KB
/
tests.yml
File metadata and controls
85 lines (76 loc) · 2.7 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
name: TESTS-CI
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
# Run Node-only unit tests across supported runtime versions.
unit-tests:
name: Unit tests (Node ${{ matrix.node }})
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node: [20, 22, 24]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- run: npm ci
- run: npm test
# Run Cypress integration tests against the example page.
# First run records a baseline, second run compares against it.
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
cache: 'npm'
- uses: actions/cache@v5
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
cypress-${{ runner.os }}-
- run: npm ci
- name: Record performance baseline
run: npm run test:integration:record
env:
CYPRESS_PERF_BROWSER: chrome
- name: Compare against baseline (no regressions expected)
run: npm run test:integration:compare
env:
CYPRESS_PERF_BROWSER: chrome
- name: Upload perf report
if: always()
id: upload_perf_report
uses: actions/upload-artifact@v4
with:
name: perf-report
path: cypress/integration-reports/perf-report.html
if-no-files-found: ignore
- name: Write job summary
if: always()
run: |
echo "## 📊 Performance Report" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
if [ -n "${{ steps.upload_perf_report.outputs.artifact-url }}" ]; then
echo "✅ **[Open perf-report.html](${{ steps.upload_perf_report.outputs.artifact-url }})**" >> "$GITHUB_STEP_SUMMARY"
else
echo "⚠️ No report artifact was generated for this run." >> "$GITHUB_STEP_SUMMARY"
fi
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "| Field | Value |" >> "$GITHUB_STEP_SUMMARY"
echo "|-------|-------|" >> "$GITHUB_STEP_SUMMARY"
echo "| Branch | \`${{ github.ref_name }}\` |" >> "$GITHUB_STEP_SUMMARY"
echo "| Commit | \`${{ github.sha }}\` |" >> "$GITHUB_STEP_SUMMARY"
echo "| Run | [#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) |" >> "$GITHUB_STEP_SUMMARY"