-
Notifications
You must be signed in to change notification settings - Fork 97
73 lines (60 loc) · 1.51 KB
/
ci-test.yml
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
name: Automated tests
on:
push:
paths:
- ".nycrc"
- "package.json"
- "buildModules.js"
- "src/**/*.html"
- "src/**/*.js"
- "src/**/*.json"
- "tests/**/*.html"
- "tests/**/*.js"
- "tests/**/*.json"
pull_request:
paths:
- ".nycrc"
- "package.json"
- "buildModules.js"
- "src/**/*.html"
- "src/**/*.js"
- "src/**/*.json"
- "tests/**/*.html"
- "tests/**/*.js"
- "tests/**/*.json"
defaults:
run:
shell: bash
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
node-version: [18.x, 20.x, 22.x]
env:
HEADLESS: true
steps:
- name: Prepare git
run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install Node.js dependencies
run: npm install
- name: Run browser tests
run: npm run test:browser
- name: Run Node.js tests
run: npm run test:node
- name: Update code coverage
run: npm run posttest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./reports/coverage-final.json
flags: unit-tests
token: ${{ secrets.CODECOV_TOKEN }}