Files
pnpm/.github/workflows/ci.yml
Zoltan Kochan 9ddc86b635 ci: track test suite durations in bencher (#12404)
## Summary

Adds CI duration tracking for the `pnpm-ci-performance` Bencher project.

Tracked Rust testbeds and benchmarks:

- `pacquet.ubuntu`, `pacquet.windows`, `pacquet.macos` -> `tests.all`
- `pnpr.ubuntu`, `pnpr.windows`, `pnpr.macos` -> `tests.all`

Tracked pnpm testbeds and benchmarks for full test runs:

- `pnpm.ubuntu.node22`, `pnpm.ubuntu.node24`, `pnpm.ubuntu.node26` -> `tests.all`, `tests.cli`
- `pnpm.windows.node22`, `pnpm.windows.node24`, `pnpm.windows.node26` -> `tests.all`, `tests.cli`

The test workflows produce Bencher-compatible JSON artifacts without receiving `BENCHER_API_TOKEN`. A separate `workflow_run` workflow downloads those artifacts only for same-repository runs, validates their metadata, and uploads from trusted workflow code using the existing `BENCHER_API_TOKEN` secret. The pnpm CLI e2e duration is extracted from `pnpm run --report-summary` output during the same full-test execution, so the CLI e2e suite is not run a second time.
2026-06-14 18:44:17 +02:00

74 lines
2.7 KiB
YAML

name: CI
on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
compile-and-lint:
# Skip pull_request events from PRs in the same repo. This prevents
# duplicate build jobs from running when creating a PR in the original repo.
# Exception: chore/update-lockfile PRs (created by automation with GITHUB_TOKEN, which doesn't trigger push events)
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository || github.head_ref == 'chore/update-lockfile' }}
name: Compile & Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Commit
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install pnpm
uses: pnpm/setup@b1cac37306e39c21283b9dd6cb0ac288fb35ba6b
- name: Compile TypeScript
run: pn compile-only
- name: Lint
run: pn lint
- name: Package compiled artifacts
shell: bash
run: |
mapfile -d '' -t lib_dirs < <(find . -type d -name lib -not -path '*/node_modules/*' -print0)
mapfile -d '' -t tsbuildinfo_files < <(find . -name 'tsconfig.tsbuildinfo' -not -path '*/node_modules/*' -print0)
tar -czf compiled.tar.gz --exclude='node_modules' "${lib_dirs[@]}" "${tsbuildinfo_files[@]}" pnpm/dist
- name: Upload compiled artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: compiled-packages
path: compiled.tar.gz
retention-days: 1
test-smoke:
name: ubuntu-latest / Node.js 24
needs: compile-and-lint
uses: ./.github/workflows/test.yml
with:
node: '24.0.0'
platform: ubuntu-latest
garnet: true
secrets:
GARNET_API_TOKEN: ${{ secrets.GARNET_API_TOKEN }}
test:
name: ${{ matrix.platform }} / Node.js ${{ matrix.node }}
needs: test-smoke
strategy:
fail-fast: false
matrix:
node: ['22.13.0', '24.0.0', '26.3.0']
platform: [ubuntu-latest, windows-latest]
exclude:
- node: '24.0.0'
platform: ubuntu-latest
# On branches, only run Windows with the lowest supported Node.js.
# Exception: main and release branches (release/x, release/x.x) run the full matrix.
- node: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && 'none' || '24.0.0' }}
platform: windows-latest
- node: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && 'none' || '26.3.0' }}
platform: windows-latest
uses: ./.github/workflows/test.yml
with:
node: ${{ matrix.node }}
platform: ${{ matrix.platform }}