-
Notifications
You must be signed in to change notification settings - Fork 592
53 lines (44 loc) · 1.26 KB
/
Copy pathci.yml
File metadata and controls
53 lines (44 loc) · 1.26 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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
syntax:
name: Node syntax check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Check JS syntax for all src files
run: |
find src -name '*.js' -type f -print0 | xargs -0 -n1 node --check
- name: Validate package.json
run: node -e "JSON.parse(require('fs').readFileSync('package.json'))"
- name: Validate JSON configs
run: |
for f in $(find . -maxdepth 2 -name '*.json' -not -path './node_modules/*' -not -path './.git/*'); do
echo "Checking $f"
node -e "JSON.parse(require('fs').readFileSync('$f'))"
done
test:
name: Unit tests shard ${{ matrix.shard }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3]
steps:
- uses: actions/checkout@v4
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Run tests
run: npm run test:shard -- ${{ matrix.shard }} 4