forked from Setono/SyliusCatalogPromotionPlugin
-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (82 loc) · 4.13 KB
/
build.yaml
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
name: build
on:
push: ~
pull_request: ~
schedule:
- cron: 5 8 * * 5
env:
APP_ENV: test
DATABASE_URL: mysql://root:[email protected]/sylius?serverVersion=5.7
jobs:
checks:
name: PHP ${{ matrix.php-versions }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1']
steps:
- name: Start MySQL
run: sudo /etc/init.d/mysql start
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: intl
coverage: none
tools: symfony
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '20.x'
- name: Install Composer dependencies
run: composer update --no-progress --no-suggest --prefer-dist --no-interaction
- name: Validate composer
run: composer validate --strict
- name: Check composer normalized
run: composer normalize --dry-run
- name: Check style
run: composer check-style
- name: Static analysis
run: composer analyse
- name: Run phpspec
run: composer phpspec
- name: Run phpunit
run: composer phpunit
- name: Setup database, assets and cache
run: |
(cd tests/Application && bin/console doctrine:database:create -vvv)
(cd tests/Application && bin/console doctrine:schema:create -vvv)
(cd tests/Application && bin/console assets:install public -vvv)
(cd tests/Application && bin/console cache:warmup -vvv)
- name: Run behat without javascript
run: vendor/bin/behat --strict -vvv --no-interaction --tags="~@javascript" || vendor/bin/behat --strict -vvv --no-interaction --tags="~@javascript" --rerun
###########################################################################
# The steps below is used to run behat with javascript. #
# If you don't have scenarios with javascript, you can remove these steps #
###########################################################################
- name: Install and build Yarn dependencies
run: |
(cd tests/Application && yarn install)
(cd tests/Application && yarn build)
- name: Output PHP version
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version
- name: Install certificates
run: symfony server:ca:install
- name: Run Chrome headless
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 &
sleep 15
curl -s -o /dev/null -I -w "%{http_code}" http://127.0.0.1:9222/json/version
- name: Run webserver
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)
- name: Run behat with javascript
run: vendor/bin/behat --strict -vvv --no-interaction --tags="@javascript" || vendor/bin/behat --strict -vvv --no-interaction --tags="@javascript" --rerun
- uses: actions/upload-artifact@v1
if: failure()
with:
name: logs
path: etc/build