Support Sylius 1.13 + 1.14 & Symfony 5.4 + 6.4 (#53) #73
This file contains 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: Build | |
on: | |
push: | |
branches-ignore: | |
- 'dependabot/**' | |
pull_request: ~ | |
release: | |
types: [created] | |
schedule: | |
- | |
cron: "0 1 * * 6" # Run at 1am every Saturday | |
workflow_dispatch: ~ | |
env: | |
SYLIUS_CACHE_DIR: /tmp/.sylius-cache | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
name: "PHP ${{ matrix.php }}, MySQL ${{ matrix.mysql }}, Sylius ${{ matrix.sylius }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [8.1, 8.2, 8.3] | |
node: [10.x] | |
mysql: [5.7, 8.0] | |
sylius: [1.13.*, 1.14.*] | |
env: | |
APP_ENV: test | |
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}" | |
steps: | |
- | |
uses: actions/checkout@v4 | |
- | |
name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php }}" | |
extensions: intl | |
tools: symfony | |
coverage: none | |
- | |
name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "${{ matrix.node }}" | |
- | |
name: Shutdown default MySQL | |
run: sudo service mysql stop | |
- | |
name: Setup MySQL | |
uses: mirromutth/mysql-action@v1.1 | |
with: | |
mysql version: "${{ matrix.mysql }}" | |
mysql root password: "root" | |
- | |
name: Output PHP version for Symfony CLI | |
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version | |
- | |
name: Install certificates | |
run: symfony server:ca:install | |
- | |
name: Run Chrome Headless | |
run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 & | |
- | |
name: Get Composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- | |
name: Cache Composer | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-php-${{ matrix.php }}-composer- | |
- | |
name: Require Sylius version | |
run: composer require sylius/sylius:"${{ matrix.sylius }}" --no-update | |
- | |
name: Install PHP dependencies | |
run: composer install --no-interaction | |
- | |
name: Get Yarn cache directory | |
id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- | |
name: Cache Yarn | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ matrix.node }}-yarn- | |
- | |
name: Validate composer.json | |
run: composer validate --ansi --strict | |
- | |
name: Run php-cs-fixer | |
run: vendor/bin/php-cs-fixer fix --verbose --diff --dry-run | |
- | |
name: Run PHPStan | |
run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/ |