Skip to content

Build

Build #337

Workflow file for this run

name: Build
on:
push:
branches-ignore:
- 'dependabot/**'
paths-ignore:
- "*.md"
pull_request:
paths-ignore:
- "*.md"
release:
types: [created]
schedule:
-
cron: "0 1 * * *" # Run at 1am every day
workflow_dispatch: ~
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
runs-on: ubuntu-latest
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, ${{ matrix.database }}"
strategy:
fail-fast: false
matrix:
php: ["8.3"]
symfony: ["^6.4", "~7.4.0"]
sylius: ["~2.2.0"]
database: ["mysql:8.4", "mariadb:11.4", "postgres:16"]
node: ["22.x"]
include:
-
php: "8.3"
symfony: "^6.4"
sylius: "~2.1.0"
database: "mysql:8.4"
node: "22.x"
env:
APP_ENV: test
steps:
-
uses: actions/checkout@v4
-
name: Parse database string
run: |
DB_TYPE="${DATABASE%%:*}"
DB_VERSION="${DATABASE##*:}"
echo "DB_TYPE=$DB_TYPE" >> $GITHUB_ENV
echo "DB_VERSION=$DB_VERSION" >> $GITHUB_ENV
if [ "$DB_TYPE" = "postgres" ]; then
echo "DATABASE_URL=pgsql://postgres:postgres@127.0.0.1/sylius?serverVersion=$DB_VERSION" >> $GITHUB_ENV
else
echo "DATABASE_URL=mysql://root:root@127.0.0.1/sylius?serverVersion=$DB_VERSION" >> $GITHUB_ENV
fi
env:
DATABASE: ${{ matrix.database }}
-
name: Build Sylius Test Application
uses: SyliusLabs/BuildTestAppAction@v3.2.0
with:
e2e_js: "yes"
cache_key: "${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}"
cache_restore_key: "${{ runner.os }}-php-${{ matrix.php }}-composer-"
database: "${{ env.DB_TYPE }}"
database_version: "${{ env.DB_VERSION }}"
node_version: "${{ matrix.node }}"
php_version: "${{ matrix.php }}"
sylius_version: "${{ matrix.sylius }}"
symfony_version: "${{ matrix.symfony }}"
-
name: Run security check
run: composer audit --abandoned=ignore
-
name: Validate composer.json
run: composer validate --ansi --strict
-
name: Run ECS
run: vendor/bin/ecs check
-
name: Lint container
run: vendor/bin/console lint:container
-
name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon.dist
-
name: Run PHPUnit (Unit)
run: vendor/bin/phpunit --colors=always --testsuite=unit
-
name: Run PHPUnit (Non-unit)
run: vendor/bin/phpunit --colors=always --testsuite=non-unit
-
name: Run Behat
run: |
vendor/bin/behat --colors --strict -vvv --no-interaction -f progress features/shop || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun features/shop
vendor/bin/behat --colors --strict -vvv --no-interaction -f progress features/admin || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun features/admin
-
name: Upload Behat logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: "Behat logs - Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, ${{ matrix.database }}"
path: etc/build/
if-no-files-found: ignore
compression-level: 6
overwrite: true