Skip to content

[CI] Replace Corepack with pnpm/setup #244

[CI] Replace Corepack with pnpm/setup

[CI] Replace Corepack with pnpm/setup #244

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
# Cancel any in-progress run for the same ref (branch/PR) when a new commit is pushed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2
with:
cache: true
- name: Lint
run: pnpm run lint
- name: Format check
run: pnpm run fmt:check
- name: Typecheck
run: pnpm run typecheck
test:
name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: ['22', '24', '26']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2
with:
runtime: node@${{ matrix.node-version }}
cache: true
- name: Build
run: pnpm build
- name: Test
run: pnpm test
bundler-versions:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
# `vite`/`@rsbuild/core` are optional peers; prove both ends of every supported major
# (the exact floor and the latest in range). `@vitejs/plugin-react@6` only peers Vite 8,
# so the Vite 7 rows pull `@vitejs/plugin-react@5` (covers 6/7/8) for the React HMR test.
- { name: 'Vite 7.0.0', add: 'vite@7.0.0 @vitejs/plugin-react@5' }
- { name: 'Vite ^7.0', add: 'vite@^7.0 @vitejs/plugin-react@5' }
- { name: 'Vite 8.0.0', add: 'vite@8.0.0' }
- { name: 'Vite ^8.0', add: 'vite@^8.0' }
- { name: 'Rsbuild 1.7.0', add: '@rsbuild/core@1.7.0' }
- { name: 'Rsbuild ^1.7', add: '@rsbuild/core@^1.7' }
- { name: 'Rsbuild 2.0.0', add: '@rsbuild/core@2.0.0' }
- { name: 'Rsbuild ^2.0', add: '@rsbuild/core@^2.0' }
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2
with:
cache: true
- name: Pin ${{ matrix.name }}
run: pnpm --filter @symfony/reprise add -D ${{ matrix.add }}
- name: Build
run: pnpm build
- name: Test
run: pnpm test
php:
name: PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }}${{ matrix.dependency-version == 'lowest' && ' lowest' || '' }} on ${{ matrix.os || 'ubuntu-latest' }}
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
# Symfony 7.4 LTS on the lowest supported PHP, resolving the lowest allowed dependencies.
- php-version: '8.4'
symfony-version: 7.4.*
dependency-version: lowest
- php-version: '8.4'
symfony-version: 8.0.*
- php-version: '8.5'
symfony-version: 7.4.*
- php-version: '8.5'
symfony-version: 8.0.*
# Windows
- php-version: '8.4'
symfony-version: 7.4.*
os: windows-latest
- php-version: '8.5'
symfony-version: 8.1.*
os: windows-latest
env:
# symfony/flex (installed as a global tool below) reads SYMFONY_REQUIRE and forces every
# symfony/* package to this version during the Composer resolution.
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ matrix.php-version }}
tools: flex
- name: Install dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
with:
dependency-versions: ${{ matrix.dependency-version == 'lowest' && 'lowest' || 'highest' }}
composer-options: --prefer-dist
custom-cache-suffix: ${{ matrix.symfony-version }}
- name: PHPUnit
run: vendor/bin/phpunit
e2e:
name: E2E ${{ matrix.name }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- {
name: 'Vite 7 · Symfony 7.4',
id: vite7-sf74,
symfony-version: 7.4.*,
bundler: vite,
add: 'vite@^7 @vitejs/plugin-react@^5',
}
- {
name: 'Vite 7 · Symfony 8.1',
id: vite7-sf81,
symfony-version: 8.1.*,
bundler: vite,
add: 'vite@^7 @vitejs/plugin-react@^5',
}
- {
name: 'Vite 8 · Symfony 7.4',
id: vite8-sf74,
symfony-version: 7.4.*,
bundler: vite,
add: 'vite@^8',
}
- {
name: 'Vite 8 · Symfony 8.1',
id: vite8-sf81,
symfony-version: 8.1.*,
bundler: vite,
add: 'vite@^8',
}
- { name: 'Rsbuild · Symfony 7.4', id: rsbuild-sf74, symfony-version: 7.4.*, bundler: rsbuild }
- { name: 'Rsbuild · Symfony 8.1', id: rsbuild-sf81, symfony-version: 8.1.*, bundler: rsbuild }
env:
# symfony/flex forces every symfony/* package to this line during the Composer resolution.
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
E2E_BUNDLER: ${{ matrix.bundler }}
E2E_ARTIFACTS: '1'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: '8.4'
tools: flex, symfony-cli
- name: Install PHP dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
with:
working-directory: playground
dependency-versions: highest
composer-options: --prefer-dist
custom-cache-suffix: ${{ matrix.symfony-version }}
- uses: pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2
with:
cache: true
- name: Pin ${{ matrix.name }}
if: matrix.add
run: pnpm -C playground add -D ${{ matrix.add }}
- name: Build Reprise
run: pnpm build
- name: Cache Playwright browsers
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: playwright-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install Playwright Chromium
run: pnpm -C playground exec playwright install --with-deps chromium
- name: E2E
run: pnpm -C playground run test:e2e
- name: Upload Playwright artifacts
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: e2e-artifacts-${{ matrix.id }}
path: playground/tests/e2e/artifacts/
if-no-files-found: ignore
retention-days: 7
php-qa:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: '8.4'
tools: composer:v2
- name: Validate composer.json
run: composer validate --strict
- name: Install dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
with:
dependency-versions: highest
composer-options: --prefer-dist
- name: PHPStan
run: vendor/bin/phpstan analyse
- name: PHP-CS-Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff
- name: Analyse Composer dependencies
run: vendor/bin/composer-dependency-analyser