-
Notifications
You must be signed in to change notification settings - Fork 4
177 lines (146 loc) · 6.08 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
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:
mysql-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"]
symfony: ["5.4.*", "^6.0"]
sylius: ["~1.12.0", "~1.13.0"]
node: ["18.x"]
mysql: ["8.0"]
env:
APP_ENV: test
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}"
steps:
-
uses: actions/checkout@v4
-
name: Restrict Sylius version
run: |
composer require --no-update --no-scripts sylius/sylius:${{ matrix.sylius }}
-
name: Build application
uses: SyliusLabs/[email protected]
with:
build_type: "plugin"
cache_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-sylius-${{ matrix.sylius }}-symfony-${{ matrix.symfony }}"
cache_restore_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-sylius-${{ matrix.sylius }}-symfony-${{ matrix.symfony }}"
e2e: "yes"
e2e_js: "yes"
database_version: ${{ matrix.mysql }}
php_version: ${{ matrix.php }}
symfony_version: ${{ matrix.symfony }}
-
name: Validate composer.json
run: composer validate --ansi --strict
-
name: Validate database schema
run: (cd tests/Application && bin/console doctrine:schema:validate)
-
name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/
-
name: Run Psalm
run: vendor/bin/psalm
-
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@v3
if: failure()
with:
name: Behat logs
path: etc/build/
if-no-files-found: ignore
postgres-tests:
runs-on: ubuntu-latest
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, PostgreSQL ${{ matrix.postgres }}"
strategy:
fail-fast: false
matrix:
php: ["8.1"]
symfony: ["5.4.*", "^6.0"]
sylius: ["~1.12.0", "~1.13.0"]
node: ["18.x"]
postgres: ["14.6"]
env:
APP_ENV: test
DATABASE_URL: "pgsql://postgres:[email protected]/sylius?charset=utf8&serverVersion=${{ matrix.postgres }}"
steps:
- name: Set postgres env
shell: bash
run: |
if [ "${{ matrix.sylius }}" == "~1.12.0" ]; then
echo "USE_LEGACY_POSTGRES_SETUP=yes" >> $GITHUB_ENV
else
echo "USE_LEGACY_POSTGRES_SETUP=no" >> $GITHUB_ENV
fi
-
uses: actions/checkout@v4
-
name: Restrict Sylius version
run: |
composer require --no-update --no-scripts sylius/sylius:${{ matrix.sylius }}
-
name: Build application
uses: SyliusLabs/[email protected]
with:
build_type: "plugin"
cache_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-sylius-${{ matrix.sylius }}-symfony-${{ matrix.symfony }}"
cache_restore_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-sylius-${{ matrix.sylius }}-symfony-${{ matrix.symfony }}"
e2e: "yes"
e2e_js: "yes"
database: "postgresql"
database_version: ${{ matrix.postgres }}
legacy_postgresql_setup: ${{ env.USE_LEGACY_POSTGRES_SETUP }}
php_version: ${{ matrix.php }}
symfony_version: ${{ matrix.symfony }}
-
name: Validate composer.json
run: composer validate --ansi --strict
-
name: Validate database schema
run: (cd tests/Application && bin/console doctrine:schema:validate)
-
name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/
-
name: Run Psalm
run: vendor/bin/psalm
-
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@v3
if: failure()
with:
name: Behat logs
path: etc/build/
if-no-files-found: ignore