-
Notifications
You must be signed in to change notification settings - Fork 9
143 lines (123 loc) · 4.21 KB
/
ci.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
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
DRIVER_URL: "http://localhost:4444"
WEB_FIXTURES_HOST: "http://localhost:8002"
defaults:
run:
shell: bash
jobs:
static:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ 8.2 ]
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: zip, :xdebug
tools: composer
- id: composer-cache
run: echo "::set-output name=directory::$(composer config cache-dir)"
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-
- run: composer update --prefer-dist
- name: Style
run: |
./bin/php-cs-fixer fix -v --diff --dry-run --rules=@Symfony
- name: Static
run: |
./bin/phpstan analyze
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ 8.0, 8.1, 8.2 ]
browser: [ chrome, firefox ]
experimental: [false]
include:
- php: 8.3
experimental: true
browser: chrome
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: zip, :xdebug
tools: composer
- name: Determine composer cache directory
id: composer-cache
run: echo "::set-output name=directory::$(composer config cache-dir)"
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-
- name: Install dependencies
run: |
mkdir -p ./logs
echo "::group::apt-get install"
sudo apt-get install xvfb
echo "::endgroup::"
echo "::group::composer update"
composer update --no-interaction --prefer-dist
echo "::endgroup::"
echo "::group::composer require symfony/phpunit-bridge"
composer require symfony/phpunit-bridge
echo "::endgroup::"
- uses: browser-actions/setup-chrome@latest
if: matrix.browser == 'chrome'
- uses: browser-actions/setup-firefox@latest
if: matrix.browser == 'firefox'
- uses: browser-actions/setup-geckodriver@latest
if: matrix.browser == 'firefox'
- name: Start ChromeDriver
if: ${{ matrix.browser == 'chrome' }}
run: |
xvfb-run --server-args="-screen 0, 1280x720x24" --auto-servernum \
chromedriver --port=4444 --verbose --whitelisted-ips= &> ./logs/chromedriver.log &
while ! nc -z localhost 4444 </dev/null; do echo Waiting for driver to start...; sleep 1; done
- name: Start GeckoDriver
if: ${{ matrix.browser == 'firefox' }}
run: |
xvfb-run --server-args="-screen 0, 1280x720x24" --auto-servernum \
geckodriver --host 127.0.0.1 -vv --port 4444 &> ./logs/geckodriver.log &
while ! nc -z localhost 4444 </dev/null; do echo Waiting for driver to start...; sleep 1; done
- name: Start webserver
shell: bash
run: |
export USE_ZEND_ALLOC=0
php -S localhost:8002 -t ./vendor/mink/driver-testsuite/web-fixtures &> ./logs/mink-test-server.log &
- name: Run tests
env:
SYMFONY_DEPRECATIONS_HELPER: 'max[total]=999999'
BROWSER_NAME: ${{ matrix.browser }}
run: |
./bin/phpunit -v
- name: Archive logs artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: logs_browser-${{ matrix.browser }}_php-${{ matrix.php }}
path: |
logs