[Autocomplete] Upgrade Foundry to ^2.0 #232
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Quality | |
on: | |
push: | |
paths-ignore: | |
- 'src/*/doc/**' | |
- 'src/**/*.md' | |
- 'ux.symfony.com/**' | |
pull_request: | |
paths-ignore: | |
- 'src/*/doc/**' | |
- 'src/**/*.md' | |
- 'ux.symfony.com/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
coding-style-js: | |
name: JavaScript Coding Style | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: npm i -g corepack && corepack enable | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'yarn' | |
- run: yarn --immutable | |
- run: yarn ci | |
coding-style-php: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
- name: Install root dependencies | |
uses: ramsey/composer-install@v3 | |
with: | |
working-directory: ${{ github.workspace }} | |
- name: php-cs-fixer | |
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff | |
phpstan: | |
name: PHPStan | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: ['8.1'] | |
dependency-version: [''] | |
symfony-version: [''] | |
minimum-stability: ['stable'] | |
include: | |
# dev packages (probably not needed to have multiple such jobs) | |
- minimum-stability: 'dev' | |
php-version: 8.4 | |
# lowest deps | |
- dependency-version: 'lowest' | |
# LTS version of Symfony | |
- symfony-version: '6.4.*' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure environment | |
run: | | |
echo COLUMNS=120 >> $GITHUB_ENV | |
echo COMPOSER_MIN_STAB='composer config minimum-stability ${{ matrix.minimum-stability || 'stable' }} --ansi' >> $GITHUB_ENV | |
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest' || '' }} --no-progress --no-interaction --ansi' >> $GITHUB_ENV | |
echo PHPUNIT_INSTALL='vendor/bin/simple-phpunit install' >> $GITHUB_ENV | |
echo PHPSTAN='vendor/bin/phpstan' >> $GITHUB_ENV | |
# TODO: Only Turbo has PHPStan configuration, let's improve this later :) | |
PACKAGES=Turbo | |
#PACKAGES=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -printf '%h\n' | sed 's/^src\///' | sort | tr '\n' ' ') | |
echo "Packages: $PACKAGES" | |
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
tools: flex | |
- name: Get composer cache directory | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache packages dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ matrix.minimum-stability }}-${{ hashFiles('src/**/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ matrix.minimum-stability }} | |
- name: Install root dependencies | |
uses: ramsey/composer-install@v3 | |
with: | |
working-directory: ${{ github.workspace }} | |
- name: Build root packages | |
run: php .github/build-packages.php | |
- name: Run PHPStan on packages | |
run: | | |
source .github/workflows/.utils.sh | |
echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} '(cd src/{} && $COMPOSER_MIN_STAB && $COMPOSER_UP && $PHPUNIT_INSTALL && $PHPSTAN)'" |