forked from qunitjs/qunit
-
Notifications
You must be signed in to change notification settings - Fork 1
146 lines (132 loc) · 4.2 KB
/
CI.yaml
File metadata and controls
146 lines (132 loc) · 4.2 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI
on:
- push
- pull_request
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
main-test:
strategy:
fail-fast: false
matrix:
include:
- name: "Linux: Node 18"
# Includes 'firefox', 'chromium', and more.
# https://github.com/actions/virtual-environments/blob/ubuntu20/20220410.2/images/linux/Ubuntu2004-Readme.md
os: ubuntu-22.04
node: 18.x
script: npm test
- name: "Linux: Node 20"
os: ubuntu-22.04
node: 20.x
script: npm run test
- name: "Linux: Node 22"
os: ubuntu-24.04
node: 22.x
script: npm run test
- name: "Demos"
os: ubuntu-22.04
node: 18.x
script: npm run test-demos
- name: "Windows: Node 18"
os: windows-latest
node: 18.x
script: npm run test-nolint
- name: "macOS: Node 18"
os: macos-13
node: 18.x
script: npm run test-nolint
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
PUPPETEER_CACHE_DIR: "${{ github.workspace }}/.puppeteer_download"
FORCE_COLOR: "1"
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: ${{ runner.os != 'Windows' }}
with:
path: |
~/.npm
${{ github.workspace }}/.puppeteer_download
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm install
- name: Tests
run: ${{ matrix.script }}
# To reproduce SpiderMonkey 102 builds locally:
#
# ```
# you:/qunit$ npm run build
#
# you:/qunit$ export MNT=$(basename "$PWD"); docker run --rm --interactive --tty --mount type=bind,source="$PWD",target="/$MNT",readonly --entrypoint /bin/sh debian:12-slim -c "cd /$MNT;bash"
# ```
# ```
# root@ubuntu:/qunit$ apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libmozjs-102-dev
# root@ubuntu:/qunit$ js102 test/mozjs.js
# ```
mozjs-102:
name: SpiderMonkey 102
runs-on: ubuntu-24.04
env:
PUPPETEER_CACHE_DIR: "${{ github.workspace }}/.puppeteer_download"
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/.puppeteer_download
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install mozjs
run: |
sudo apt-get install -y libmozjs-102-dev
- run: npm install
- run: npm run build
- name: Test mozjs.js
run: js102 test/mozjs.js
- name: Test mozjs.mjs
run: js102 -m test/mozjs.mjs
# To reproduce SpiderMonkey 115 builds locally:
#
# ```
# you:/qunit$ npm run build
#
# you:/qunit$ export MNT=$(basename "$PWD"); docker run --rm --interactive --tty --mount type=bind,source="$PWD",target="/$MNT",readonly --entrypoint /bin/sh ubuntu:24.04 -c "cd /$MNT;bash"
# ```
# ```
# root@ubuntu:/qunit$ apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libmozjs-115-dev
# root@ubuntu:/qunit$ js115 test/mozjs.js
# ```
mozjs-115:
name: SpiderMonkey 115
runs-on: ubuntu-24.04
env:
PUPPETEER_CACHE_DIR: "${{ github.workspace }}/.puppeteer_download"
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/.puppeteer_download
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install mozjs
run: |
sudo apt-get install -y libmozjs-115-dev
- run: npm install
- run: npm run build
- name: Test mozjs.js
run: js115 test/mozjs.js
- name: Test mozjs.mjs
run: js115 -m test/mozjs.mjs