Skip to content

Commit 79d1e5e

Browse files
authored
Merge pull request #505 from SzymonKostrubiec/op-351
OP-351 - Update builds
2 parents 8a6bb73 + 5051cf2 commit 79d1e5e

3 files changed

Lines changed: 120 additions & 138 deletions

File tree

.github/workflows/build.yml

Lines changed: 44 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
name: Build
2-
32
on:
43
push:
54
branches-ignore:
65
- 'dependabot/**'
76
pull_request: ~
87
release:
9-
types: [created]
8+
types: [ created ]
109
schedule:
11-
-
12-
cron: "0 1 * * 6" # Run at 1am every Saturday
10+
- cron: "0 1 * * 6"
1311
workflow_dispatch: ~
1412

1513
jobs:
@@ -21,160 +19,140 @@ jobs:
2119
strategy:
2220
fail-fast: false
2321
matrix:
24-
php: ["8.1", "8.2", "8.3"]
25-
symfony: ["^5.4", "^6.4"]
26-
sylius: ["~1.12.0", "~1.13.0"]
27-
node: ["18.x", "20.x"]
28-
mysql: ["8.0"]
22+
php: [ "8.0", "8.1", "8.2", "8.3" ]
23+
symfony: [ "^5.4", "^6.4" ]
24+
sylius: [ "^1.12", "^1.13" ]
25+
node: [ "18.x", "20.x" ]
26+
mysql: [ "8.0" ]
27+
28+
exclude:
29+
- sylius: ^1.13
30+
php: 8.0
31+
- sylius: ^1.12
32+
php: 8.0
33+
symfony: ^6.4
2934

3035
env:
3136
APP_ENV: test
3237
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}"
3338

3439
steps:
35-
-
36-
uses: actions/checkout@v3
40+
- uses: actions/checkout@v3
3741

38-
-
39-
name: Setup PHP
42+
- name: Setup PHP
4043
uses: shivammathur/setup-php@v2
4144
with:
4245
php-version: "${{ matrix.php }}"
4346
extensions: intl
4447
tools: flex, symfony
4548
coverage: none
4649

47-
-
48-
name: Setup Node
50+
- name: Setup Node
4951
uses: actions/setup-node@v4
5052
with:
5153
node-version: "${{ matrix.node }}"
5254

53-
-
54-
name: Shutdown default MySQL
55+
- name: Shutdown default MySQL
5556
run: sudo service mysql stop
5657

57-
-
58-
name: Setup MySQL
58+
- name: Setup MySQL
5959
uses: mirromutth/mysql-action@v1.1
6060
with:
6161
mysql version: "${{ matrix.mysql }}"
6262
mysql root password: "root"
6363

64-
-
65-
name: Output PHP version for Symfony CLI
64+
- name: Output PHP version for Symfony CLI
6665
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version
6766

68-
-
69-
name: Install certificates
67+
- name: Install certificates
7068
run: symfony server:ca:install
7169

7270
- name: Run Chrome Headless
7371
run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 &
7472

75-
-
76-
name: Run webserver
73+
- name: Run webserver
7774
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)
7875

79-
-
80-
name: Get Composer cache directory
76+
- name: Get Composer cache directory
8177
id: composer-cache
8278
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
8379

84-
-
85-
name: Cache Composer
80+
- name: Cache Composer
8681
uses: actions/cache@v4
8782
with:
8883
path: ${{ steps.composer-cache.outputs.dir }}
8984
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
9085
restore-keys: |
9186
${{ runner.os }}-php-${{ matrix.php }}-composer-
9287
93-
-
94-
name: Restrict Sylius version
88+
- name: Restrict Sylius version
9589
if: matrix.sylius != ''
9690
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction
9791

98-
-
99-
name: Install PHP dependencies
92+
- name: Install PHP dependencies
10093
run: composer install --no-interaction
10194
env:
102-
SYMFONY_REQUIRE: ${{ matrix.symfony }}
95+
SYMFONY_REQUIRE: ${{ matrix.symfony }}
10396

104-
-
105-
name: Install Behat driver
97+
- name: Install Behat driver
10698
run: vendor/bin/bdi browser:google-chrome drivers
10799

108-
-
109-
name: Get Yarn cache directory
100+
- name: Get Yarn cache directory
110101
id: yarn-cache
111102
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
112103

113-
-
114-
name: Cache Yarn
104+
- name: Cache Yarn
115105
uses: actions/cache@v4
116106
with:
117107
path: ${{ steps.yarn-cache.outputs.dir }}
118108
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
119109
restore-keys: |
120110
${{ runner.os }}-node-${{ matrix.node }}-yarn-
121111
122-
-
123-
name: Install JS dependencies
112+
- name: Install JS dependencies
124113
run: |
125114
(cd tests/Application && yarn install)
126115
127-
-
128-
name: Prepare test application database
116+
- name: Prepare test application database
129117
run: |
130118
(cd tests/Application && bin/console doctrine:database:create -vvv)
131119
(cd tests/Application && bin/console doctrine:migrations:migrate -n -vvv -q)
132120
133-
-
134-
name: Prepare test application assets
121+
- name: Prepare test application assets
135122
run: |
136123
(cd tests/Application && bin/console assets:install public -vvv)
137124
(cd tests/Application && yarn build:prod)
138125
139-
-
140-
name: Prepare test application cache
126+
- name: Prepare test application cache
141127
run: (cd tests/Application && bin/console cache:warmup -vvv)
142128

143-
-
144-
name: Load fixtures in test application
129+
- name: Load fixtures in test application
145130
run: (cd tests/Application && bin/console sylius:fixtures:load -n)
146131

147-
-
148-
name: Validate composer.json
132+
- name: Validate composer.json
149133
run: composer validate --ansi --strict
150134

151-
-
152-
name: Validate database schema
135+
- name: Validate database schema
153136
run: (cd tests/Application && bin/console doctrine:schema:validate)
154137

155-
-
156-
name: Run PHPSpec
138+
- name: Run PHPSpec
157139
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
158140

159-
-
160-
name: Run PHPUnit
141+
- name: Run PHPUnit
161142
run: vendor/bin/phpunit --colors=always
162143

163-
-
164-
name: Run Behat
165-
run: vendor/bin/behat --colors --strict -vvv --no-interaction -f progress || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun
144+
- name: Run Behat
145+
run: vendor/bin/behat --colors --strict -vvv --no-interaction -f progress || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun
166146

167-
-
168-
name: Upload Behat logs
147+
- name: Upload Behat logs
169148
uses: actions/upload-artifact@v3
170149
if: failure()
171150
with:
172151
name: Behat logs
173152
path: etc/build/
174153
if-no-files-found: ignore
175154

176-
-
177-
name: Failed build Slack notification
155+
- name: Failed build Slack notification
178156
uses: rtCamp/action-slack-notify@v2
179157
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
180158
env:
@@ -184,4 +162,4 @@ jobs:
184162
SLACK_MESSAGE: ':x:'
185163
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
186164
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
187-
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}
165+
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}
Lines changed: 74 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,88 @@
11
name: Coding standard
22

33
on:
4-
push:
5-
branches-ignore:
6-
- 'dependabot/**'
7-
pull_request: ~
8-
release:
9-
types: [created]
10-
schedule:
11-
-
12-
cron: "0 1 * * 6" # Run at 1am every Saturday
13-
workflow_dispatch: ~
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request: ~
8+
release:
9+
types: [ created ]
10+
workflow_dispatch: ~
1411

1512
jobs:
16-
tests:
17-
runs-on: ubuntu-latest
13+
tests:
14+
runs-on: ubuntu-latest
1815

19-
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}"
16+
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}"
2017

21-
strategy:
22-
fail-fast: false
23-
matrix:
24-
php: ["8.1"]
25-
symfony: ["^5.4", "^6.4"]
26-
sylius: ["~1.13.0"]
27-
node: ["20.x"]
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
php: [ "8.0", "8.1", "8.2", "8.3" ]
22+
symfony: [ "^5.4", "^6.4" ]
23+
sylius: [ "^1.12", "^1.13" ]
24+
node: [ "18.x", "20.x" ]
2825

29-
env:
30-
APP_ENV: test
26+
exclude:
27+
- sylius: ^1.13
28+
php: 8.0
29+
- sylius: ^1.12
30+
php: 8.0
31+
symfony: ^6.4
32+
33+
steps:
34+
- uses: actions/checkout@v3
3135

32-
steps:
33-
-
34-
uses: actions/checkout@v3
35-
-
36-
name: Setup PHP
37-
uses: shivammathur/setup-php@v2
38-
with:
39-
php-version: "${{ matrix.php }}"
40-
extensions: intl
41-
tools: flex, symfony
42-
coverage: none
43-
-
44-
name: Get Composer cache directory
45-
id: composer-cache
46-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
36+
- name: Setup PHP
37+
uses: shivammathur/setup-php@v2
38+
with:
39+
php-version: "${{ matrix.php }}"
40+
extensions: intl
41+
tools: symfony
42+
coverage: none
4743

48-
-
49-
name: Cache Composer
50-
uses: actions/cache@v4
51-
with:
52-
path: ${{ steps.composer-cache.outputs.dir }}
53-
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
54-
restore-keys: |
55-
${{ runner.os }}-php-${{ matrix.php }}-composer-
56-
-
57-
name: Restrict Sylius version
58-
if: matrix.sylius != ''
59-
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction
44+
- name: Get Composer cache directory
45+
id: composer-cache
46+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6047

61-
-
62-
name: Install PHP dependencies
63-
run: composer install --no-interaction
64-
env:
65-
SYMFONY_REQUIRE: ${{ matrix.symfony }}
48+
- name: Cache Composer
49+
uses: actions/cache@v4
50+
with:
51+
path: ${{ steps.composer-cache.outputs.dir }}
52+
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json', '**/composer.lock') }}
53+
restore-keys: |
54+
${{ runner.os }}-php-${{ matrix.php }}-composer-
6655
67-
-
68-
name: Run PHPStan
69-
run: vendor/bin/phpstan analyse
56+
- name: Restrict Symfony version
57+
if: matrix.symfony != ''
58+
run: |
59+
composer global config --no-plugins allow-plugins.symfony/flex true
60+
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
61+
composer config extra.symfony.require "${{ matrix.symfony }}"
7062
71-
- name: Run ECS
72-
run: vendor/bin/ecs
63+
- name: Restrict Sylius version
64+
if: matrix.sylius != ''
65+
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction
66+
67+
- name: Install PHP dependencies
68+
run: composer install --no-interaction
69+
env:
70+
SYMFONY_REQUIRE: ${{ matrix.symfony }}
7371

74-
- name: Failed build Slack notification
75-
uses: rtCamp/action-slack-notify@v2
76-
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
77-
env:
78-
SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }}
79-
SLACK_COLOR: ${{ job.status }}
80-
SLACK_ICON: https://github.com/rtCamp.png?size=48
81-
SLACK_MESSAGE: ':x:'
82-
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
83-
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
84-
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}
72+
- name: Run PHPStan
73+
run: vendor/bin/phpstan analyse -c phpstan.neon.dist -l 8 src/
74+
75+
- name: Run ECS
76+
run: vendor/bin/ecs
77+
78+
- name: Failed build Slack notification
79+
uses: rtCamp/action-slack-notify@v2
80+
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
81+
env:
82+
SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }}
83+
SLACK_COLOR: ${{ job.status }}
84+
SLACK_ICON: https://github.com/rtCamp.png?size=48
85+
SLACK_MESSAGE: ':x:'
86+
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
87+
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
88+
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)