Skip to content

Old Node.js Compatibility #1666

Old Node.js Compatibility

Old Node.js Compatibility #1666

Workflow file for this run

name: Old Node.js Compatibility
on:
push:
branches:
- main
paths:
- 'api/**'
- '.github/workflows/backcompat.yml'
pull_request:
paths:
- 'api/**'
- '.github/workflows/backcompat.yml'
merge_group:
paths:
- 'api/**'
- '.github/workflows/backcompat.yml'
permissions:
contents: read
jobs:
backcompat:
name: 'backcompat: ${{ matrix.package }} on Node.js ${{ matrix.node-version }}'
strategy:
fail-fast: false
matrix:
include:
- package: api
node-version: '8'
script: test/backcompat/node8-compat.js
runs-on: ubuntu-latest
env:
PACKAGE: ${{ matrix.package }}
NODE_VERSION: ${{ matrix.node-version }}
SCRIPT: ${{ matrix.script }}
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
# Use a modern Node.js to install dependencies and compile TypeScript.
- name: Setup Node.js (compile)
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: ^26.3.0
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Bootstrap
run: npm ci --ignore-scripts
- name: Compile
run: npm run compile
# Switch to the target old Node.js and run the standalone plain-JS smoke
# test. Package is already compiled and dependencies are already installed.
- name: Setup Node.js ${{ env.NODE_VERSION }} (test)
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Run compatibility smoke test
run: node "$SCRIPT"
working-directory: ${{ env.PACKAGE }}