Files
pnpm/.github/workflows/test.yml
dependabot[bot] d67385eac1 chore(deps): bump the github-actions group across 1 directory with 12 updates
Bumps the github-actions group with 12 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [dorny/paths-filter](https://github.com/dorny/paths-filter) | `4.0.1` | `4.0.2` |
| [github/codeql-action/init](https://github.com/github/codeql-action) | `4.36.2` | `4.36.3` |
| [github/codeql-action/autobuild](https://github.com/github/codeql-action) | `4.36.2` | `4.36.3` |
| [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.36.2` | `4.36.3` |
| [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `4.1.0` | `4.2.0` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `4.1.0` | `4.2.0` |
| [docker/login-action](https://github.com/docker/login-action) | `4.2.0` | `4.4.0` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `7.2.0` | `7.3.0` |
| [taiki-e/install-action](https://github.com/taiki-e/install-action) | `2.82.5` | `2.82.9` |
| [crate-ci/typos](https://github.com/crate-ci/typos) | `1.47.2` | `1.48.0` |
| [garnet-org/action](https://github.com/garnet-org/action) | `2.0.2` | `2.2.0` |
| [warpdotdev/oz-agent-action](https://github.com/warpdotdev/oz-agent-action) | `1.0.21` | `1.0.23` |



Updates `dorny/paths-filter` from 4.0.1 to 4.0.2
- [Release notes](https://github.com/dorny/paths-filter/releases)
- [Changelog](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md)
- [Commits](fbd0ab8f3e...7b450fff21)

Updates `github/codeql-action/init` from 4.36.2 to 4.36.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](8aad20d150...54f647b7e1)

Updates `github/codeql-action/autobuild` from 4.36.2 to 4.36.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](8aad20d150...54f647b7e1)

Updates `github/codeql-action/analyze` from 4.36.2 to 4.36.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](8aad20d150...54f647b7e1)

Updates `docker/setup-qemu-action` from 4.1.0 to 4.2.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](06116385d9...96fe6ef7f3)

Updates `docker/setup-buildx-action` from 4.1.0 to 4.2.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](d7f5e7f509...bb05f3f551)

Updates `docker/login-action` from 4.2.0 to 4.4.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](650006c6eb...af1e73f918)

Updates `docker/build-push-action` from 7.2.0 to 7.3.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](f9f3042f7e...53b7df96c9)

Updates `taiki-e/install-action` from 2.82.5 to 2.82.9
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](bffeee26d4...4684b84056)

Updates `crate-ci/typos` from 1.47.2 to 1.48.0
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](37bb98842b...bee27e3a4f)

Updates `garnet-org/action` from 2.0.2 to 2.2.0
- [Release notes](https://github.com/garnet-org/action/releases)
- [Commits](2b7fc9d79b...3d47f4a900)

Updates `warpdotdev/oz-agent-action` from 1.0.21 to 1.0.23
- [Release notes](https://github.com/warpdotdev/oz-agent-action/releases)
- [Commits](1922f22c00...8ba4e14206)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-version: 1.48.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: docker/build-push-action
  dependency-version: 7.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: docker/login-action
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: docker/setup-qemu-action
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: dorny/paths-filter
  dependency-version: 4.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: garnet-org/action
  dependency-version: 2.1.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.36.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.36.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/init
  dependency-version: 4.36.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: taiki-e/install-action
  dependency-version: 2.82.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: warpdotdev/oz-agent-action
  dependency-version: 1.0.23
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-13 09:30:55 +00:00

280 lines
9.9 KiB
YAML

name: Test (reusable)
on:
workflow_call:
inputs:
node:
required: true
type: string
node_major:
required: true
type: string
platform:
required: true
type: string
garnet:
required: false
type: boolean
default: false
test_chunk:
required: false
type: string
default: '1'
test_chunk_total:
required: false
type: string
default: '1'
secrets:
GARNET_API_TOKEN:
required: false
permissions:
contents: read
jobs:
test:
name: Node ${{ inputs.node_major }} / chunk ${{ inputs.test_chunk }}/${{ inputs.test_chunk_total }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.platform }}-${{ inputs.node }}-${{ inputs.test_chunk }}-${{ inputs.test_chunk_total }}
cancel-in-progress: true
runs-on: ${{ inputs.platform }}
steps:
# A near-full "affected packages" sweep can exhaust the hosted runner's
# free disk mid-test (the runner worker itself dies with "No space left
# on device"). Drop the preinstalled toolchains this job never uses
# (~25 GB) first.
- name: Free up runner disk space
if: ${{ runner.os == 'Linux' }}
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
df -h /
- name: Configure Git
run: |
git config --global core.autocrlf false
git config --global user.name "xyz"
git config --global user.email "x@y.z"
- name: Checkout Commit
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- if: ${{ inputs.garnet }}
uses: garnet-org/action@3d47f4a9004f7356c980a0e8d420ef5984750e3c # v2.2.0
with:
api_token: ${{ secrets.GARNET_API_TOKEN }}
- name: Install pnpm and Node
uses: pnpm/setup@77cf06832101b3ac8c65caaf76a21643936d07a4
with:
runtime: node@${{ inputs.node }}
- name: Verify Node version
shell: bash
env:
NODE_VERSION: ${{ inputs.node }}
# `pn node -v` falls back through `run`/`exec`, which would
# otherwise trigger a verifyDepsBeforeRun install just to print
# the version. Disable it so this step measures the runtime that
# pnpm/setup provisioned, not one a stray install pulled in.
pnpm_config_verify_deps_before_run: false
run: |
actual=$(pn node -v)
expected="v${NODE_VERSION}"
if [ "$actual" != "$expected" ]; then
echo "Expected Node version $expected but got $actual"
exit 1
fi
# npm is needed for preparing git-hosted dependencies (e.g. in dlx tests).
# `pnpm runtime set node` does not extract npm; the runner image's
# pre-installed Node toolchain provides it on PATH.
- name: Verify npm
run: npm --version
- name: Download compiled artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: compiled-packages
- name: Extract compiled artifacts
run: tar -xzf compiled.tar.gz
# The test harness serves package fixtures through the in-repo `pnpr`
# server; `pnpr-prepare` turns the raw fixtures under
# `pnpr/.fixtures/packages` into the storage the server reads. Both are
# built from source (so the tests exercise the current server, not a
# published `@pnpm/pnpr` that may predate it) once per OS by the
# `build-pnpr` reusable workflow, then shared with every test job/shard
# here as an artifact instead of rebuilt per job.
- name: Download prebuilt pnpr binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: pnpr-bins-${{ runner.os }}
path: .pnpr-bin
- name: Export pnpr binary paths
shell: bash
run: |
ext=""
[ -f "$PWD/.pnpr-bin/pnpr.exe" ] && ext=".exe"
# Artifacts don't preserve the executable bit; restore it on POSIX.
[ -z "$ext" ] && chmod +x "$PWD/.pnpr-bin/pnpr" "$PWD/.pnpr-bin/pnpr-prepare"
echo "PNPR_BIN=$PWD/.pnpr-bin/pnpr$ext" >> "$GITHUB_ENV"
echo "PNPR_PREPARE_BIN=$PWD/.pnpr-bin/pnpr-prepare$ext" >> "$GITHUB_ENV"
- name: Determine test scope
id: test-scope
shell: bash
env:
REF_NAME: ${{ github.ref_name }}
run: |
if [[ "$REF_NAME" == "main" || "$REF_NAME" == "chore/update-lockfile" || "$REF_NAME" == release/* ]]; then
{
echo "script=ci:test-all"
echo "scope=all"
echo "full_tests=true"
echo "benchmark=tests.all"
} >> "$GITHUB_OUTPUT"
else
git remote set-branches --add origin main && git fetch origin main --depth=1
if [ -n "$(git diff --name-only origin/main HEAD -- pnpm-workspace.yaml)" ]; then
{
echo "script=ci:test-all"
echo "scope=all — pnpm-workspace.yaml modified"
echo "full_tests=true"
echo "benchmark=tests.all"
} >> "$GITHUB_OUTPUT"
else
{
echo "script=ci:test-branch"
echo "scope=affected packages"
echo "full_tests=false"
echo "benchmark=tests.affected"
} >> "$GITHUB_OUTPUT"
fi
fi
- name: Validate test chunk inputs
shell: bash
env:
TEST_CHUNK: ${{ inputs.test_chunk }}
TEST_CHUNK_TOTAL: ${{ inputs.test_chunk_total }}
run: |
case "$TEST_CHUNK" in
''|*[!0-9]*)
echo "::error::test_chunk must be a positive integer"
exit 1
;;
esac
case "$TEST_CHUNK_TOTAL" in
''|*[!0-9]*)
echo "::error::test_chunk_total must be a positive integer"
exit 1
;;
esac
if (( TEST_CHUNK < 1 || TEST_CHUNK_TOTAL < 1 || TEST_CHUNK > TEST_CHUNK_TOTAL )); then
echo "::error::test_chunk must be between 1 and test_chunk_total"
exit 1
fi
- name: Run tests (${{ steps.test-scope.outputs.scope }})
timeout-minutes: 70
shell: bash
env:
BENCHMARK: ${{ steps.test-scope.outputs.benchmark }}
PNPM_WORKERS: 3
TEST_SCRIPT: ${{ steps.test-scope.outputs.script }}
TEST_CHUNK: ${{ inputs.test_chunk }}
TEST_CHUNK_TOTAL: ${{ inputs.test_chunk_total }}
run: |
benchmark="$BENCHMARK"
command=(pn run "$TEST_SCRIPT")
if [ "$TEST_CHUNK_TOTAL" != "1" ]; then
benchmark="${BENCHMARK}.chunk${TEST_CHUNK}"
command=(
node .github/scripts/run-ts-tests-chunk.mjs
--script "$TEST_SCRIPT"
--chunk "$TEST_CHUNK"
--chunks "$TEST_CHUNK_TOTAL"
)
fi
node .github/scripts/measure-command.mjs \
--name "$benchmark" \
--output ".bench/${benchmark}.json" \
-- "${command[@]}"
- name: Extract pnpm CLI e2e test duration
if: steps.test-scope.outputs.full_tests == 'true'
shell: bash
env:
TEST_CHUNK: ${{ inputs.test_chunk }}
TEST_CHUNK_TOTAL: ${{ inputs.test_chunk_total }}
run: |
benchmark=tests.cli
args=(
--name "$benchmark"
--output ".bench/${benchmark}.json"
--package-dir pnpm11/pnpm
)
if [ "$TEST_CHUNK_TOTAL" != "1" ]; then
benchmark="${benchmark}.chunk${TEST_CHUNK}"
args=(
--name "$benchmark"
--output ".bench/${benchmark}.json"
--package-dir pnpm11/pnpm
--allow-missing
)
fi
node .github/scripts/bencher-result-from-pnpm-summary.mjs "${args[@]}"
- name: Stage Bencher test durations
if: steps.test-scope.outputs.full_tests == 'true'
env:
BENCHMARK: ${{ steps.test-scope.outputs.benchmark }}
NODE_VERSION: ${{ inputs.node }}
PLATFORM: ${{ inputs.platform }}
TEST_CHUNK: ${{ inputs.test_chunk }}
TEST_CHUNK_TOTAL: ${{ inputs.test_chunk_total }}
shell: bash
run: |
benchmark="$BENCHMARK"
cli_benchmark=tests.cli
if [ "$TEST_CHUNK_TOTAL" != "1" ]; then
benchmark="${BENCHMARK}.chunk${TEST_CHUNK}"
cli_benchmark="${cli_benchmark}.chunk${TEST_CHUNK}"
fi
platform_slug=${PLATFORM%-latest}
node_major=${NODE_VERSION%%.*}
case "$platform_slug" in
ubuntu|windows) ;;
*)
echo "::error::Unsupported platform '$platform_slug' for pnpm benchmarks; expected ubuntu or windows"
exit 1
;;
esac
case "$node_major" in
22|24|26) ;;
*)
echo "::error::Unsupported Node major '$node_major' for pnpm benchmarks; expected 22, 24, or 26"
exit 1
;;
esac
artifact_dir=.bench/artifact/pnpm
mkdir -p "$artifact_dir"
files=(".bench/${benchmark}.json")
if [ -f ".bench/${cli_benchmark}.json" ]; then
files+=(".bench/${cli_benchmark}.json")
fi
node .github/scripts/merge-bencher-results.mjs \
--output "$artifact_dir/results.json" \
-- "${files[@]}"
cat > "$artifact_dir/metadata.json" <<EOF
{
"kind": "pnpm",
"testbed": "pnpm.${platform_slug}.node${node_major}",
"chunk": {
"index": ${TEST_CHUNK},
"total": ${TEST_CHUNK_TOTAL}
}
}
EOF
- name: Upload Bencher test duration artifact
if: steps.test-scope.outputs.full_tests == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ci-performance-pnpm-${{ inputs.platform }}-node-${{ inputs.node }}-chunk-${{ inputs.test_chunk }}-of-${{ inputs.test_chunk_total }}
path: .bench/artifact/pnpm/
if-no-files-found: error
retention-days: 14