-
Notifications
You must be signed in to change notification settings - Fork 39
111 lines (101 loc) · 3.23 KB
/
test.yml
File metadata and controls
111 lines (101 loc) · 3.23 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Test
on:
pull_request:
workflow_dispatch:
workflow_call:
jobs:
test:
strategy:
matrix:
operating_system:
- ubuntu-22.04
- windows-latest
- macos-latest
node_version:
- 20
- 24
exclude:
- operating_system: windows-latest
node_version: 24
- operating_system: macos-latest
node_version: 24
fail-fast: false # run tests on other operating systems even if one fails
runs-on: ${{ matrix.operating_system }}
steps:
- run: |
git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: ankane/setup-mongodb@v1
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- run: npm ci
- name: Run tests (Linux)
if: ${{ runner.os == 'Linux' }}
run: npm test
- name: Run tests (Windows or macOS)
if: ${{ runner.os == 'Windows' || runner.os == 'macOS' }}
run: npm test -- --timeout 5000
validate_declarations:
strategy:
matrix:
operating_system:
- ubuntu-22.04 # Using Ubuntu 22.04 due to AppArmor restrictions in newer versions (23.10+) that interfere with Puppeteer's sandbox functionality. See https://pptr.dev/troubleshooting#issues-with-apparmor-on-ubuntu
- windows-latest
- macos-latest
node_version:
- 20
- 24
exclude:
- operating_system: windows-latest
node_version: 24
- operating_system: macos-latest
node_version: 24
fail-fast: false # run tests on other operating systems even if one fails
runs-on: ${{ matrix.operating_system }}
steps:
- run: |
git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: OpenTermsArchive/demo-declarations
path: ./demo-declarations
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- run: cd ./demo-declarations && npm install
- run: npm ci
- run: ./node_modules/.bin/cross-env NODE_ENV=ci npm run declarations:lint
- run: ./node_modules/.bin/cross-env NODE_ENV=ci npm run declarations:validate:schema
validate_metadata:
strategy:
matrix:
operating_system:
- ubuntu-22.04
- windows-latest
- macos-latest
node_version:
- 20
- 24
exclude:
- operating_system: windows-latest
node_version: 24
- operating_system: macos-latest
node_version: 24
fail-fast: false
runs-on: ${{ matrix.operating_system }}
steps:
- run: |
git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: OpenTermsArchive/demo-declarations
path: ./demo-declarations
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- run: cd ./demo-declarations && npm install
- run: npm ci
- run: ./node_modules/.bin/cross-env NODE_ENV=ci npm run metadata:validate