Drop node < 18 #828
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
os: ubuntu-20.04 | |
node: 18.x | |
script: npm run test-nolint | |
- name: "Integration" | |
os: ubuntu-20.04 | |
node: 18.x | |
script: npm run test-integration | |
- name: "Windows: Node 18" | |
os: windows-latest | |
node: 18.x | |
script: npm run test-nolint | |
- name: "macOS: Node 18" | |
os: macos-latest | |
node: 18.x | |
script: npm run test-nolint | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
env: | |
PUPPETEER_DOWNLOAD_PATH: "${{ github.workspace }}/.puppeteer_download" | |
FORCE_COLOR: "1" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
if: ${{ runner.os != 'Windows' }} | |
with: | |
path: | | |
~/.npm | |
${{ github.workspace }}/.puppeteer_download | |
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Use Node.js ${{ matrix.node }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- run: npm ci | |
- name: Tests | |
run: ${{ matrix.script }} | |
# To reproduce SpiderMonkey builds locally: | |
# | |
# 1. Run the build the same way you normally do. | |
# ``` | |
# nobody@nodejs-isolated:/qunit$ npm run build | |
# ``` | |
# 2. Start a temporary Docker container using the official Ubuntu image from DockerHub, | |
# and mount the current working directory in it: | |
# ``` | |
# you@host:/qunit$ MNT=$(basename "$PWD"); docker run --rm --interactive --tty --mount type=bind,source="$PWD",target="/$MNT",readonly --entrypoint /bin/sh ubuntu:focal -c "cd /$MNT;bash" | |
# ``` | |
# 3. Run the following from the Docker container's bash prompt: | |
# ``` | |
# root@ubuntu-tmp/qunit$ apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libmozjs-68-dev | |
# root@ubuntu-tmp/qunit$ js68 test/mozjs.js | |
# root@ubuntu-tmp/qunit$ js68 test/benchmark/index-mozjs.js | |
# ``` | |
sm-test: | |
name: SpiderMonkey | |
runs-on: ubuntu-20.04 | |
env: | |
PUPPETEER_DOWNLOAD_PATH: "${{ github.workspace }}/.puppeteer_download" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.npm | |
${{ github.workspace }}/.puppeteer_download | |
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Install mozjs | |
run: | | |
sudo apt-fast install -y libmozjs-68-dev | |
- run: npm ci | |
- run: npm run build | |
- name: Tests | |
run: js68 test/mozjs.js |