Skip to content

chore(deps): update node.js dependencies #13799

chore(deps): update node.js dependencies

chore(deps): update node.js dependencies #13799

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Tests
on:
push:
branches: [master]
pull_request:
branches: [master, feat/v6]
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
# Detect which parts of the repository changed so we only run the test
# suites that are actually affected:
# - Any Lua script change (the shared core used by every runtime), or a
# change under `scripts/**` used by pretest/build generation, runs ALL
# runtime suites.
# - A change scoped to a single runtime (node/php) runs only that
# runtime's suite.
# - Documentation-only changes only run this change-detection job and a
# no-op `smoke` job (to satisfy required checks).
# Shared build inputs (package.json, yarn.lock, this workflow) are grouped
# under `lua` so that changing them re-runs every runtime as well.
changes:
runs-on: ubuntu-latest
name: detect changed paths
permissions:
contents: read
pull-requests: read
outputs:
lua: ${{ steps.filter.outputs.lua }}
node: ${{ steps.filter.outputs.node }}
php: ${{ steps.filter.outputs.php }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Detect changed paths
id: filter
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
with:
filters: |
lua:
- 'src/commands/**/*.lua'
- 'package.json'
- 'yarn.lock'
- 'scripts/**'
- '.github/workflows/test.yml'
node:
- 'src/**'
- 'tests/**'
- 'tsconfig*.json'
- 'vitest*.ts'
- 'bun-test-preload.ts'
- 'mocha.setup.ts'
- '.mocharc.js'
- 'eslint.config.mjs'
php:
- 'php/**'
# Fast smoke test gate. Runs a small subset of fast, representative tests
# against the default (node + ioredis) adapter with --bail so we fail fast.
# All other heavier jobs depend on this so a quick failure cancels the rest.
# (Vulnerability scanning runs in the separate `osv-scanner.yml` workflow
# and gates merging via branch protection / required checks.)
smoke:
runs-on: ubuntu-latest
needs: changes
name: smoke (lint + fast tests on node@lts, ioredis, redis@7)
env:
node-version: lts/*
redis-version: 7-alpine
steps:
- name: Skip smoke run when node/lua inputs are unchanged
if: ${{ needs.changes.outputs.node != 'true' && needs.changes.outputs.lua != 'true' }}
run: echo "No node/lua changes detected; skipping smoke steps."
- name: Checkout repository
if: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Use Node.js
if: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ env.node-version }}
cache: 'yarn'
- name: Start Redis
if: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
uses: supercharge/redis-github-action@bc274cb7238cd63a45029db04ee48c07a72609fd # 1.8.1
with:
redis-version: ${{ env.redis-version }}
- if: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
run: yarn install --ignore-engines --frozen-lockfile --non-interactive
- name: Run ESLint
if: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
run: yarn lint
- if: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
run: yarn build
- if: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
run: yarn test:smoke
# Primary ioredis test run on a single (current LTS) Node version.
# Also produces the coverage report — the test set executed by
# `yarn coverage` is exactly `yarn test` + `yarn test:ioredis`, so running
# them under coverage avoids doing the same work twice in CI.
# Acts as the gating job for the other adapters: if this passes,
# node-redis, node-valkey, node-dragonflydb, bun, and the additional
# ioredis Node/Redis version matrix run in parallel.
ioredis-redis:
runs-on: ubuntu-latest
needs: [changes, smoke]
# Keep the matrix job itself materialized so required checks still get the
# concrete matrix-expanded name even when path filtering decides the steps
# should no-op for this PR.
if: ${{ !cancelled() && needs.smoke.result == 'success' }}
name: testing node@${{ matrix.node-version }}, redis@${{ matrix.redis-version }}
env:
allowed_coverage_change: -0.25
should_run: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
strategy:
matrix:
node-version: [lts/*]
redis-version: [7-alpine]
steps:
- name: Skip when node/lua inputs are unchanged
if: env.should_run != 'true'
run: echo "No node/lua changes detected; skipping ioredis coverage job."
- name: Checkout repository
if: env.should_run == 'true'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Use Node.js ${{ matrix.node-version }}
if: env.should_run == 'true'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Start Redis
if: env.should_run == 'true'
uses: supercharge/redis-github-action@bc274cb7238cd63a45029db04ee48c07a72609fd # 1.8.1
with:
redis-version: ${{ matrix.redis-version }}
- if: env.should_run == 'true'
run: yarn install --ignore-engines --frozen-lockfile --non-interactive
- if: env.should_run == 'true'
run: yarn build
- name: Run tests with coverage (default + ioredis-only suites)
if: env.should_run == 'true'
run: yarn coverage
- name: Upload LCOV to Coveralls
if: ${{ env.should_run == 'true' && (( github.event_name == 'pull_request' && github.event.pull_request.head.fork == false ) || github.event_name == 'push') }}
uses: coverallsapp/github-action@0a51d2e0b5417d06e4ecceb534aec87defc53926 # branch=master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-error: false
- name: Check coverage change not below threshold
if: ${{ env.should_run == 'true' && (( github.event_name == 'pull_request' && github.event.pull_request.head.fork == false ) || github.event_name == 'push') }}
shell: bash
run: |
sleep 2
COVERALLS_RESPONSE=$(curl -fsSL https://coveralls.io/builds/${{ github.sha }}.json || true)
COVERAGE_CHANGE=$(echo "${COVERALLS_RESPONSE}" | jq -er '.coverage_change | select(type == "number")' 2>/dev/null || true)
if [[ -z "${COVERAGE_CHANGE}" ]]; then
echo "::warning::Skipping coverage threshold check because Coveralls was unavailable or did not return a numeric coverage_change."
exit 0
fi
echo coverage changed by ${COVERAGE_CHANGE}%
if [[ -z "$(echo ${COVERAGE_CHANGE} ${{ env.allowed_coverage_change }} | awk '$1 >= $2')" ]]; then
echo current coverage change ${COVERAGE_CHANGE}% below threshold ${{ env.allowed_coverage_change }}%
exit 1
fi
# Additional ioredis matrix coverage. Only runs once the primary
# ioredis-redis job has passed to avoid burning runner time on
# multiple Node/Redis versions when the suite is already broken.
ioredis-redis-extra:
runs-on: ubuntu-latest
needs: [changes, ioredis-redis]
name: testing node@${{ matrix.node-version }}, redis@${{ matrix.redis-version }}
env:
should_run: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
strategy:
fail-fast: false
matrix:
node-version: [lts/-1, lts/-2]
redis-version: [7-alpine]
include:
- node-version: 'lts/*'
redis-version: 6-alpine
steps:
- name: Skip when node/lua inputs are unchanged
if: env.should_run != 'true'
run: echo "No node/lua changes detected; skipping extra ioredis matrix steps."
- name: Checkout repository
if: env.should_run == 'true'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Use Node.js ${{ matrix.node-version }}
if: env.should_run == 'true'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Start Redis
if: env.should_run == 'true'
uses: supercharge/redis-github-action@bc274cb7238cd63a45029db04ee48c07a72609fd # 1.8.1
with:
redis-version: ${{ matrix.redis-version }}
- if: env.should_run == 'true'
run: yarn install --ignore-engines --frozen-lockfile --non-interactive
- if: env.should_run == 'true'
run: yarn build
- if: env.should_run == 'true'
run: yarn test
- if: env.should_run == 'true'
run: yarn test:ioredis
node-redis:
runs-on: ubuntu-latest
needs: [changes, ioredis-redis]
name: testing node-redis node@${{ matrix.node-version }}, redis@${{ matrix.redis-version }}
env:
should_run: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
strategy:
matrix:
node-version: [lts/*]
redis-version: [7-alpine]
steps:
- name: Skip when node/lua inputs are unchanged
if: env.should_run != 'true'
run: echo "No node/lua changes detected; skipping node-redis test steps."
- name: Checkout repository
if: env.should_run == 'true'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Use Node.js ${{ matrix.node-version }}
if: env.should_run == 'true'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Start Redis
if: env.should_run == 'true'
uses: supercharge/redis-github-action@bc274cb7238cd63a45029db04ee48c07a72609fd # 1.8.1
with:
redis-version: ${{ matrix.redis-version }}
- if: env.should_run == 'true'
run: yarn install --ignore-engines --frozen-lockfile --non-interactive
- if: env.should_run == 'true'
run: yarn build
- if: env.should_run == 'true'
run: yarn test:adapter-conformance
- if: env.should_run == 'true'
run: yarn test:node-redis
node-valkey:
runs-on: ubuntu-latest
needs: [changes, ioredis-redis]
env:
node-version: lts/*
should_run: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
name: testing node@lts/*, valkey@8
services:
valkey:
image: valkey/valkey:8-alpine3.20
ports:
- 6379:6379
steps:
- name: Skip when node/lua inputs are unchanged
if: env.should_run != 'true'
run: echo "No node/lua changes detected; skipping valkey test steps."
- name: Checkout repository
if: env.should_run == 'true'
uses: actions/checkout@v7.0.1
- name: Use Node.js ${{ env.node-version }}
if: env.should_run == 'true'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: lts/*
cache: 'yarn'
- if: env.should_run == 'true'
run: yarn install --ignore-engines --frozen-lockfile --non-interactive
- if: env.should_run == 'true'
run: yarn build
- if: env.should_run == 'true'
run: yarn test
node-dragonflydb:
runs-on: ubuntu-latest
needs: [changes, ioredis-redis]
env:
node-version: lts/*
should_run: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
name: testing node@lts/*, dragonflydb@latest
services:
dragonflydb:
image: docker.dragonflydb.io/dragonflydb/dragonfly:latest
env:
DFLY_cluster_mode: emulated
DFLY_lock_on_hashtags: true
HEALTHCHECK_PORT: 6379
ports:
- 6379:6379
steps:
- name: Skip when node/lua inputs are unchanged
if: env.should_run != 'true'
run: echo "No node/lua changes detected; skipping dragonflydb test steps."
- name: Checkout repository
if: env.should_run == 'true'
uses: actions/checkout@v7.0.1
- name: Use Node.js ${{ env.node-version }}
if: env.should_run == 'true'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: lts/*
cache: 'yarn'
- if: env.should_run == 'true'
run: yarn install --ignore-engines --frozen-lockfile --non-interactive
- if: env.should_run == 'true'
run: yarn build
- if: env.should_run == 'true'
run: BULLMQ_TEST_PREFIX={b} yarn test
postgres:
runs-on: ubuntu-latest
needs: [changes, ioredis-redis]
name: testing node@${{ matrix.node-version }}, postgres@${{ matrix.postgres-version }}
env:
should_run: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
strategy:
matrix:
node-version: [lts/*]
postgres-version: [16]
services:
# The PostgreSQL backend under test. Credentials/database match the
# default POSTGRES_URL used by the tests (see tests/postgres/utils).
# No Redis service: the PostgreSQL test run uses a no-op connection
# factory, so `yarn test:postgres` needs no Redis server.
postgres:
image: postgres:${{ matrix.postgres-version }}-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: bullmq_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Skip when node/lua inputs are unchanged
if: env.should_run != 'true'
run: echo "No node/lua changes detected; skipping postgres test steps."
- name: Checkout repository
if: env.should_run == 'true'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Use Node.js ${{ matrix.node-version }}
if: env.should_run == 'true'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- if: env.should_run == 'true'
run: yarn install --ignore-engines --frozen-lockfile --non-interactive
# `yarn build` runs the pretest codegen (raw scripts, command transforms)
# and compiles the sources the shared test classes import.
- if: env.should_run == 'true'
run: yarn build
- if: env.should_run == 'true'
run: yarn test:postgres
bun-redis:
runs-on: ubuntu-latest
needs: [changes, ioredis-redis]
name: testing bun@${{ matrix.bun-version }}, redis@${{ matrix.redis-version }}
env:
should_run: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.lua == 'true' }}
strategy:
matrix:
bun-version: [latest]
redis-version: [7-alpine]
steps:
- name: Skip when node/lua inputs are unchanged
if: env.should_run != 'true'
run: echo "No node/lua changes detected; skipping Bun test steps."
- name: Checkout repository
if: env.should_run == 'true'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Bun
if: env.should_run == 'true'
uses: oven-sh/setup-bun@v2.2.0
with:
bun-version: ${{ matrix.bun-version }}
- name: Use Node.js for yarn
if: env.should_run == 'true'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: lts/*
cache: 'yarn'
- name: Start Redis
if: env.should_run == 'true'
uses: supercharge/redis-github-action@bc274cb7238cd63a45029db04ee48c07a72609fd # 1.8.1
with:
redis-version: ${{ matrix.redis-version }}
- if: env.should_run == 'true'
run: yarn install --ignore-engines --frozen-lockfile --non-interactive
- if: env.should_run == 'true'
run: yarn build
- if: env.should_run == 'true'
run: yarn test:bun:smoke
- if: env.should_run == 'true'
run: yarn test:bun
# node-upstash:
# runs-on: ubuntu-latest
# continue-on-error: true
# env:
# node-version: lts/*
# REDIS_HOST: ${{ secrets.REDIS_HOST }}
# name: testing node@lts/*, upstash@latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3 # v3
# - name: Use Node.js ${{ env.node-version }}
# uses: actions/setup-node@v3 # v3
# with:
# node-version: lts/*
# cache: 'yarn'
# - run: yarn install --ignore-engines --frozen-lockfile --non-interactive
# - run: yarn build
# - run: yarn test
php:
runs-on: ubuntu-latest
needs: [changes, smoke, ioredis-redis]
# Keep failure/cancellation gating at the job level, but leave path gating
# to step-level no-op checks so the matrix-expanded required check name
# still materializes when PHP/Lua files are unchanged.
if: >-
always() &&
!cancelled() &&
needs.smoke.result == 'success' &&
needs.ioredis-redis.result != 'failure' &&
needs.ioredis-redis.result != 'cancelled'
name: testing php@${{ matrix.php-version }}, redis@7
env:
should_run: ${{ needs.changes.outputs.php == 'true' || needs.changes.outputs.lua == 'true' }}
strategy:
matrix:
node-version: [lts/*]
php-version: ['8.1', '8.2', '8.3']
steps:
- name: Skip when PHP/Lua inputs are unchanged
if: env.should_run != 'true'
run: echo "No PHP/Lua changes detected; skipping PHP test steps."
- name: Checkout repository
if: env.should_run == 'true'
uses: actions/checkout@v7.0.1
- name: Use Node.js ${{ matrix.node-version }}
if: env.should_run == 'true'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Start Redis
if: env.should_run == 'true'
uses: supercharge/redis-github-action@bc274cb7238cd63a45029db04ee48c07a72609fd # 1.8.1
with:
redis-version: 7-alpine
- if: env.should_run == 'true'
run: yarn install --ignore-engines --frozen-lockfile --non-interactive
- if: env.should_run == 'true'
run: yarn build
- if: env.should_run == 'true'
run: yarn copy:lua:php
- name: Setup PHP
if: env.should_run == 'true'
uses: shivammathur/setup-php@2.37.2
with:
php-version: ${{ matrix.php-version }}
extensions: redis, msgpack
tools: composer:v2
- name: Get Composer Cache Directory
if: env.should_run == 'true'
id: composer-cache
working-directory: php
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
if: env.should_run == 'true'
uses: actions/cache@v6.1.0
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('php/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php-version }}-
- name: Install PHP dependencies
if: env.should_run == 'true'
working-directory: php
run: composer install --prefer-dist --no-progress
- name: Run PHPStan
if: env.should_run == 'true'
working-directory: php
run: ./vendor/bin/phpstan analyse src --level=6
- name: Run tests
if: env.should_run == 'true'
working-directory: php
run: ./vendor/bin/phpunit