-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
88 lines (77 loc) · 2.25 KB
/
ci-test.yml
File metadata and controls
88 lines (77 loc) · 2.25 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
name: Testing
on:
push:
branches:
- main
- dev-2.0
pull_request:
branches:
- '*'
permissions:
contents: read
jobs:
test:
strategy:
matrix:
include:
- os: ubuntu-latest
browser: chrome
# - os: windows-latest
# browser: chrome
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- name: Use Node.js 22.x
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22.x
- name: Verify Chrome (Ubuntu)
if: matrix.os == 'ubuntu-latest' && matrix.browser == 'chrome'
run: |
google-chrome --version
- name: Verify Chrome (Windows)
if: matrix.os == 'windows-latest' && matrix.browser == 'chrome'
run: |
& "C:\Program Files\Google\Chrome\Application\chrome.exe" --version
- name: Get node modules
run: npm ci
env:
CI: true
- name: Build and test (Ubuntu)
id: test
if: matrix.os == 'ubuntu-latest'
run: npm test -- --project=unit-tests
continue-on-error: true
env:
CI: true
- name: Generate Visual Test Report
if: always()
run: node visual-report.js
env:
CI: true
- name: Upload Visual Test Report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: visual-test-report
path: test/unit/visual/visual-report.html
retention-days: 14
- name: generate TypeScript types
run: npm run generate-types
env:
CI: true
- name: test TypeScript types
run: npm run test:types
env:
CI: true
- name: report test coverage
if: steps.test.outcome == 'success'
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
files: coverage/coverage-final.json
fail_ci_if_error: false
- name: fail job if tests failed
if: steps.test.outcome != 'success'
run: exit 1