chromedevtools--chrome-devtools-mcp
13613b4a33
Initially, we started with the support of Node22+ but since Node20 is an LTS that is still in the maintenance mode it makes sense to support it.
77 行
1.8 KiB
YAML
77 行
1.8 KiB
YAML
name: Compile and run tests
|
|
|
|
permissions: read-all
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
jobs:
|
|
run-tests:
|
|
name: Tests on ${{ matrix.os }} with node ${{ matrix.node }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- windows-latest
|
|
- macos-latest
|
|
node:
|
|
- 20
|
|
- 22
|
|
- 23
|
|
- 24
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
|
with:
|
|
cache: npm
|
|
node-version: 22 # build works only with 22+.
|
|
|
|
- name: Install dependencies
|
|
shell: bash
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
|
with:
|
|
cache: npm
|
|
node-version: ${{ matrix.node }}
|
|
|
|
- name: Disable AppArmor
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
shell: bash
|
|
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
|
|
|
|
- name: Run tests (node20)
|
|
if: ${{ matrix.node == '20' }}
|
|
shell: bash
|
|
run: npm run test:node20
|
|
|
|
- name: Run tests
|
|
shell: bash
|
|
if: ${{ matrix.node != '20' }}
|
|
run: npm run test
|
|
|
|
# Gating job for branch protection.
|
|
test-success:
|
|
name: '[Required] Tests passed'
|
|
runs-on: ubuntu-latest
|
|
needs: run-tests
|
|
if: ${{ !cancelled() }}
|
|
steps:
|
|
- if: ${{ needs.run-tests.result != 'success' }}
|
|
run: 'exit 1'
|
|
- run: 'exit 0'
|