Skip to content

chore: release the three packages as one unit, starting with a beta #280

chore: release the three packages as one unit, starting with a beta

chore: release the three packages as one unit, starting with a beta #280

Workflow file for this run

# Node floor is 22.13: @strapi/utils (Strapi 5.52.0) pins preferred-pm@5.0.0,
# which declares engines node ">=22.13". The former ceiling of 22.x came from
# @strapi/sdk-plugin@5.x and was lifted by the move to sdk-plugin 6 (#134), so
# this now matches Strapi's own matrix.
name: tests
on:
workflow_call:
push:
branches:
- main
- 'dev/**'
pull_request:
branches: [main]
jobs:
# The e2e jobs below can only run on Node 22, because Strapi 5.52.0 itself
# cannot be installed on anything else (see the note at the top of this file).
# That left the Node versions where the providers actually fail to load
# unreachable from CI, which is how #118 / #123 / #116 survived a green build.
#
# This job closes that gap: it installs on 22, then exercises the providers
# standalone (no Strapi) across every Node version we claim to support.
provider_smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
# Note: deliberately no `cache: pnpm`. setup-node keys the pnpm store
# cache on OS + lockfile hash only, with no Node version, so every matrix
# leg shares one store. That store holds compiled native addons, so a
# better-sqlite3 built under one Node ABI gets restored under another and
# crashes with "Assertion failed: (env) != nullptr". pnpm installs are
# fast enough that correctness is the better trade.
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm run build
# The .mjs half of the dual package is never exercised by the e2e suite,
# which loads the CommonJS entry. A bare `require` surviving into it is a
# ReferenceError for anyone whose runtime takes the `import` branch, so
# assert against the built bundle rather than the source.
- run: pnpm run test:esm
# Cluster safety is a provider concern and needs the built plugin types,
# so it runs here rather than in the lint job.
- run: pnpm run test:cluster
# Deliberately includes 20: it is below Strapi's install floor of 22.13,
# but it is exactly where the ESM/interop provider bugs reproduce, so a
# regression there must fail the build. (Node 18 is EOL and is covered by
# engines.node ">=20.0.0".)
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 20
- run: node scripts/provider-smoke.cjs
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
- run: node scripts/provider-smoke.cjs
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24
- run: node scripts/provider-smoke.cjs
linters:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [22, 24, 26]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
# The providers typecheck against the plugin's published type entry,
# which only exists once the plugin is built.
- run: pnpm run build
- run: pnpm run test:lint
# Boots each playground in a real child process.
#
# Every other suite boots Strapi inside jest, whose module resolver is far
# more permissive than Node's. The plugin resolves its cache provider by
# package name at boot, so a provider jest can find but Node cannot gives a
# completely green build for an application that cannot start. That is not
# hypothetical - it is how the redis provider became unresolvable under pnpm
# while e2e_redis stayed green.
boot_smoke:
runs-on: ubuntu-latest
services:
redis:
image: bitnami/redis:latest
env:
ALLOW_EMPTY_PASSWORD: yes
ports:
- 6379:6379
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version: 22
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm run build
- run: pnpm run test:boot
e2e_memory:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [22, 24, 26]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm run postinstall:memory
- run: pnpm run build
- name: Run Memory e2e tests
working-directory: playgrounds/memory
run: pnpm run test:e2e
# Browser coverage for the admin panel. The jest suites boot Strapi in-process
# and never render anything, which is how the panel stayed broken for the
# whole Strapi 5 line without a red build.
#
# One Node version only: this builds the admin panel, which is minutes, and
# what it guards is browser behaviour rather than anything Node-version
# specific.
e2e_admin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm run build
- name: Install Playwright browser
run: pnpm exec playwright install --with-deps chromium
- name: Run admin panel e2e tests
run: pnpm run test:admin
- if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: playwright-output
path: e2e/.output/
retention-days: 7
e2e_redis:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [22, 24, 26]
services:
redis:
image: bitnami/redis:latest
env:
ALLOW_EMPTY_PASSWORD: yes
ports:
# Opens tcp port 6379 on the host and service container
- 6379:6379
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm run postinstall:redis
- run: pnpm run build
- name: Run Redis e2e tests
working-directory: playgrounds/redis
run: pnpm run test:e2e