11name : Build
2-
32on :
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
1513jobs :
@@ -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 }}
0 commit comments