-
Notifications
You must be signed in to change notification settings - Fork 19
111 lines (82 loc) · 2.31 KB
/
ci.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
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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: npm install
run: npm ci
- name: lint
run: npm run lint --quiet --max-warnings=0
jest-tests:
# This shouldn't take long, and if it does something bad has happened and it should be killed
timeout-minutes: 20
env:
COVERAGE_NODE_VERSION: 18
COVERAGE_OS: 'ubuntu-latest'
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [ 16, 18, 20 ]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: npm ci
run: npm ci
- name: npm run parsers
run: npm run parsers
- name: npm test
run: npm test -- --ci --no-cache
env:
CI: true
# Run codecov after all builds, and only on a single environment
- name: Gather Coverage
if: matrix.os == env.COVERAGE_OS && matrix.node-version == env.COVERAGE_NODE_VERSION
run: npm test -- --ci --coverage
- name: Upload Coverage
uses: codecov/codecov-action@v3
if: matrix.os == env.COVERAGE_OS && matrix.node-version == env.COVERAGE_NODE_VERSION
with:
files: ./coverage/coverage-final.json
playwright-tests:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: npm update
run: npm i npm@latest -g
- name: npm ci
run: npm ci
- name: npm run parsers
run: npm run parsers
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
- name: test
run: npm run test:playwright
- uses: actions/upload-artifact@v3
if: failure()
with:
name: playwright-report
path: playwright-report/
retention-days: 30