-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (87 loc) · 2.4 KB
/
quality.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
112
113
114
115
name: Quality check
on:
push:
branches:
- main
pull_request:
branches: [ main ]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: NodeJS
uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 19.x
- run: node -p process.versions
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
unit-tests:
name: Unit tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [18.x, 19.x]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: ${{ matrix.node-version }}
- run: node -p process.versions
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm test
coverage:
name: Report coverage
env:
CC_TEST_REPORTER_ID: a2d82974a4532d427b8855175de07eabef6bba36a8025d3c346a3ead1be33141
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: NodeJS
uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 19.x
- run: node -p process.versions
- name: Install dependencies
run: npm ci
- name: Set up CodeClimate reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- name: Run unit tests and report
run: |
./cc-test-reporter before-build
npm test -- --coverage
EXIT_CODE=$?
mv ./packages/coverage/clover.xml ./clover.xml
./cc-test-reporter after-build -t clover --exit-code $EXIT_CODE
audit:
name: Audit dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: NodeJS
uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 19.x
- run: node -p process.versions
- name: Install dependencies
run: npm ci
- name: Audit dependencies
run: npm audit