Skip to content

Build

Build #2019

Workflow file for this run

name: Build
on:
push:
branches-ignore:
- 'dependabot/**'
pull_request: ~
release:
types: [created]
schedule:
-
cron: "0 1 * * 6" # Run at 1am every Saturday
workflow_dispatch: ~
jobs:
tests:
runs-on: ubuntu-latest
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }},
MySQL ${{ matrix.mysql }}, Node ${{ matrix.node }}"
strategy:
fail-fast: false
matrix:
php: [ "8.1", "8.2", "8.3" ]
symfony: ["^5.4", "^6.4"]
sylius: [ "~1.13.0", "~1.14.0" ]
node: [ "18.x", "20.x" ]
mysql: ["8.0"]
exclude:
-
php: "8.3"
symfony: "^5.4"
sylius: "~1.13.0"
env:
APP_ENV: test
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}"
steps:
-
uses: actions/checkout@v3
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
extensions: intl
tools: symfony
coverage: none
-
name: Build test application
uses: SyliusLabs/BuildTestAppAction@v1.3
with:
sylius-version: "${{ matrix.sylius }}"
symfony-version: "${{ matrix.symfony }}"
mysql-version: "${{ matrix.mysql }}"
node-version: "${{ matrix.node }}"
working-directory: "."
plugin-build: "yes"
-
name: Validate composer.json
run: composer validate --ansi --strict
-
name: Validate database schema
run: (cd tests/Application && bin/console doctrine:schema:validate)
-
name: Run PHPSpec
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
-
name: Run PHPUnit
run: vendor/bin/phpunit --colors=always
-
name: Run Behat
run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun
-
name: Upload Behat logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: Behat logs
path: etc/build/
if-no-files-found: ignore
-
name: Upload test log logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: Var logs
path: tests/Application/var/log/
if-no-files-found: ignore
-
name: Failed build Slack notification
uses: rtCamp/action-slack-notify@v2
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
env:
SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }}
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://github.com/rtCamp.png?size=48
SLACK_MESSAGE: ':x:'
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}