Skip to content

Build

Build #411

Workflow file for this run

name: Build
on:
push:
paths-ignore:
- "docs/**"
- "*.md"
pull_request:
paths-ignore:
- "docs/**"
- "*.md"
release:
types: [created]
schedule:
-
cron: "0 1 * * 6" # Run at 1am every Saturday
workflow_dispatch: ~
jobs:
tests:
runs-on: ubuntu-20.04
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}"
strategy:
fail-fast: false
matrix:
php: ["8.0", "8.1"]
symfony: ["^5.4", "^6.0"]
sylius: ["~1.11.10", "~1.12.0"]
node: ["16.x"]
mysql: ["5.7", "8.0"]
exclude:
- sylius: "~1.11.10"
symfony: "^6.0"
env:
APP_ENV: test
APP_SECRET: "Dead men tell no tales"
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}"
MESSENGER_TRANSPORT_DSN: "sync://"
MAILER_DSN: "null://null"
steps:
-
uses: actions/checkout@v2
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
extensions: intl, gd, opcache, mysql, pdo_mysql
tools: symfony
coverage: none
-
name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "${{ matrix.node }}"
-
name: Shutdown default MySQL
run: sudo service mysql stop
-
name: Setup MySQL
uses: mirromutth/[email protected]
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: Restrict Symfony version
if: matrix.symfony != ''
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
composer config extra.symfony.require "${{ matrix.symfony }}"
-
name: Restrict Sylius version
if: matrix.sylius != ''
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction
-
name: Install PHP dependencies
run: composer update --no-interaction
-
name: Prepare test application database
run: |
(cd tests/Application && bin/console doctrine:database:create -vvv)
(cd tests/Application && bin/console doctrine:schema:create -vvv)
-
name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon --no-progress src
-
name: Run Codestyle
run: vendor/bin/ecs check
-
name: Run PHPSpec
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
-
name: Run PHPUnit
run: vendor/bin/phpunit --colors=always