minor #2764 [CI] Re-organize workflows: split unit/functional/app tes… #23
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: Unit Tests | |
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: | |
php: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: ['8.1', '8.2', '8.3', '8.4'] | |
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 | |
- php-version: '8.1' | |
dependency-version: 'lowest' | |
# LTS version of Symfony | |
- php-version: '8.1' | |
symfony-version: '6.4.*' | |
env: | |
SYMFONY_REQUIRE: ${{ matrix.symfony-version }} | |
steps: | |
- 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='vendor/bin/simple-phpunit' >> $GITHUB_ENV | |
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak | |
# Swup and Typed have no tests, Turbo has its own workflow file | |
PACKAGES=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -printf '%h\n' | sed 's/^src\///' | grep -Ev "Swup|Turbo|Typed" | sort | tr '\n' ' ') | |
echo "Packages: $PACKAGES" | |
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
tools: flex | |
- name: Install root dependencies | |
run: composer install | |
- name: Build root packages | |
run: php .github/build-packages.php | |
- name: Run packages tests | |
run: | | |
source .github/workflows/.utils.sh | |
echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} '(cd src/{} && $COMPOSER_MIN_STAB && $COMPOSER_UP && $PHPUNIT)'" | |
js: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: npm i -g corepack && corepack enable | |
- uses: actions/setup-node@v4 | |
with: | |
cache: 'yarn' | |
cache-dependency-path: | | |
yarn.lock | |
package.json | |
src/**/package.json | |
- run: yarn --immutable | |
- run: yarn playwright install | |
- run: yarn test |