-
Notifications
You must be signed in to change notification settings - Fork 61
106 lines (88 loc) · 3.19 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
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 }}