Skip to content

build(deps-dev): Bump the minor-dependencies group with 3 updates #59

build(deps-dev): Bump the minor-dependencies group with 3 updates

build(deps-dev): Bump the minor-dependencies group with 3 updates #59

name: "🔍 Tests PR"
on:
pull_request:
branches: [main]
merge_group:
workflow_dispatch:
permissions:
contents: read
concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
linting:
name: lint
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
- name: node
uses: actions/setup-node@v6
with:
node-version: 22
cache: "npm"
- name: install dependencies
run: npm ci
- name: install clang-tidy
run: sudo apt-get install -y clang-tidy
- name: build project
# Build project so that imports can be checked during linting
run: npm run build
- name: build fuzzer
# Build the native addon so that CMake downloads libFuzzer and
# generates compile_commands.json, which are needed by clang-tidy
run: npm run build --workspace=@jazzer.js/fuzzer
- name: check formatting and linting
run: npm run check
tests:
name: unit tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, ubuntu-24.04-arm, macos-latest]
node: [20]
include:
# Node 14 runtime compatibility is covered by end-to-end tests.
# Unit tests require npm 7+ (workspaces) which Node 14 doesn't ship.
# Ceiling: current LTS
- os: ubuntu-latest
node: 24
steps:
- name: checkout
uses: actions/checkout@v6
- uses: actions/cache@v5
id: cache-fuzzer
with:
path: |
packages/fuzzer/prebuilds
key:
fuzzer-cache-${{ matrix.os }}-${{
hashFiles('packages/fuzzer/CMakeLists.txt',
'packages/fuzzer/**/*.h', 'packages/fuzzer/**/*.cpp') }}
- name: node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: "npm"
- name: MSVC (windows)
uses: ilammy/msvc-dev-cmd@v1
if: contains(matrix.os, 'windows')
- name: install dependencies
run: npm ci
- name: build project
run: npm run build
- name: build fuzzer
if: ${{ steps.cache-fuzzer.outputs.cache-hit != 'true' }}
run: npm run build --workspace=@jazzer.js/fuzzer
- name: run all tests
run: npm run test
end-to-end:
name: end-to-end (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
steps:
- name: checkout
uses: actions/checkout@v6
# Build with node.js 22
- name: node
uses: actions/setup-node@v6
with:
node-version: 22
cache: "npm"
- name: MSVC (windows)
uses: ilammy/msvc-dev-cmd@v1
if: contains(matrix.os, 'windows')
- name: pack jazzer.js
run: cd end-to-end && ./package-jazzer-js.sh
shell: bash
- name: build example
run: cd end-to-end && npm install --save-dev *.tgz && npm run build
shell: bash
# Run with different node.js versions
# all in one job to avoid rebuilding
# Node 14 only has binaries for x64 runners
- name: "node 14"
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'
uses: actions/setup-node@v6
with:
node-version: 14
- name: run tests (node 14)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'
run: cd end-to-end && npx jest
shell: bash
- name: "node 16"
uses: actions/setup-node@v6
with:
node-version: 16
- name: run tests (node 16)
run: cd end-to-end && npx jest
shell: bash
- name: "node 18"
uses: actions/setup-node@v6
with:
node-version: 18
- name: run tests (node 18)
run: cd end-to-end && npx jest
shell: bash
- name: "node 20"
uses: actions/setup-node@v6
with:
node-version: 20
- name: run tests (node 20)
run: cd end-to-end && npx jest
shell: bash
- name: "node 22"
uses: actions/setup-node@v6
with:
node-version: 22
- name: run tests (node 22)
run: cd end-to-end && npx jest
shell: bash
- name: "node 24"
uses: actions/setup-node@v6
with:
node-version: 24
- name: run tests (node 24)
run: cd end-to-end && npx jest
shell: bash
auto-merge:
needs:
- linting
- tests
- end-to-end
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.3.6
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve
if:
${{steps.metadata.outputs.update-type !=
'version-update:semver-major'}}
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge
if:
${{steps.metadata.outputs.update-type !=
'version-update:semver-major'}}
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}