Skip to content

OP-291: Refactor behats #1574

OP-291: Refactor behats

OP-291: Refactor behats #1574

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-20.04
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }},
MySQL ${{ matrix.mysql }}, State Machine Adapter ${{ matrix.state_machine_adapter }}"
strategy:
fail-fast: false
matrix:
php: [ "8.1" ]
symfony: [ "^5.4", "^6.0" ]
sylius: [ "~1.12.13", "~1.13.0" ]
node: [ "^14.17.x" ]
mysql: [ "8.0" ]
state_machine_adapter: [ "winzou_state_machine", "symfony_workflow" ]
exclude:
- sylius: ~1.12.13
state_machine_adapter: "symfony_workflow"
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, gd
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 ECS
run: vendor/bin/ecs
- name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon
- 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@v2
if: failure()
with:
name: Behat logs
path: etc/build/
if-no-files-found: ignore
- name: Upload test log logs
uses: actions/upload-artifact@v2
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 }}