[WIP]OP-289: test #490
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: ~ | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ "8.1", "8.2", "8.3" ] | |
symfony: [ "^5.4", "^6.4" ] | |
sylius: [ "^1.12", "^1.13" ] | |
node: [ "18.x", "20.x" ] | |
mysql: [ "8.0" ] | |
env: | |
APP_ENV: test | |
DATABASE_URL: "mysql://root:[email protected]/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: Build test application | |
uses: SyliusLabs/[email protected] | |
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 API tests | |
run: vendor/bin/phpunit tests/Api --colors=always | |
- name: Run PHPUnit tests | |
run: vendor/bin/phpunit tests/Unit --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@v3 | |
if: failure() | |
with: | |
name: Behat logs | |
path: etc/build/ | |
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 }} |