-
Notifications
You must be signed in to change notification settings - Fork 118
153 lines (137 loc) · 4.83 KB
/
tests.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
name: Tests
on:
pull_request: ~
push: ~
concurrency:
group: ${{ github.workflow }} @ ${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
tests:
name: PHP ${{ matrix.php }} - ${{ matrix.dependencies || format('Symfony {0}', matrix.symfony) }}${{ (matrix.note && format(' ({0})', matrix.note)) || '' }}${{ (matrix.allow-failure && ' 🔕') || '' }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allow-failure || false }}
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}
SYMFONY_DEPRECATIONS_HELPER: ${{ matrix.symfony-deprecations }}
DB_DSN_MYSQL: mysql://test:[email protected]/craue_form_flow_tests
DB_DSN_POSTGRESQL: pgsql://test:[email protected]/craue_form_flow_tests
DB_DSN_SQLITE: sqlite:///sqlite.db
strategy:
fail-fast: false
matrix:
include:
-
php: '7.3'
dependencies: lowest
-
php: '8.3'
dependencies: highest
-
php: '7.3'
symfony: '4.4.*'
-
php: '7.4'
symfony: '5.4.*'
# TODO remove as soon as Symfony >= 5.0 is required
-
php: '7.4'
symfony: '5.4.*'
note: contao-polyfill-symfony
contao-polyfill-symfony: true
-
php: '8.0'
symfony: '5.4.*'
-
php: '8.1'
symfony: '5.4.*'
-
php: '8.1'
symfony: '6.3.*'
-
php: '8.2'
symfony: '6.4.*'
-
php: '8.3'
symfony: '6.4.*'
-
php: '8.2'
symfony: '7.0.*'
services:
mysql:
image: mysql:${{ (matrix.php == '7.3' && '5.7') || '8.0' }}
env:
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_DATABASE: craue_form_flow_tests
MYSQL_ALLOW_EMPTY_PASSWORD: yes
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 5s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
postgres:
image: postgres
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: craue_form_flow_tests
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pdo_mysql, pdo_pgsql, pdo_sqlite
coverage: pcov
ini-values: memory_limit=-1, variables_order="EGPCS"
tools: flex
env:
fail-fast: true # interrupt on extension setup error
# TODO remove as soon as Symfony >= 5.0 is required
- name: require contao/polyfill-symfony
if: matrix.contao-polyfill-symfony == true
run: composer require --no-update --dev contao/polyfill-symfony
- name: use dev dependencies
if: matrix.stability == 'dev'
run: composer config minimum-stability dev
- name: install dependencies with Composer
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: --prefer-dist
- name: run PHPUnit
run: vendor/bin/phpunit -v --coverage-clover build/logs/clover.xml --exclude-group run-with-multiple-databases-only
- name: run PHPUnit with MySQL
if: always()
run: vendor/bin/phpunit -v --coverage-clover build/logs/clover-mysql.xml --group run-with-multiple-databases,run-with-multiple-databases-only
env:
DB_FLAVOR: mysql
- name: run PHPUnit with PostgreSQL
if: always()
run: vendor/bin/phpunit -v --coverage-clover build/logs/clover-postgresql.xml --group run-with-multiple-databases,run-with-multiple-databases-only
env:
DB_FLAVOR: postgresql
- name: run PHPUnit with SQLite
if: always()
run: vendor/bin/phpunit -v --coverage-clover build/logs/clover-sqlite.xml --group run-with-multiple-databases,run-with-multiple-databases-only
env:
DB_FLAVOR: sqlite
- name: upload code coverage data
if: github.repository == 'craue/CraueFormFlowBundle'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: PHP ${{ matrix.php }} - ${{ matrix.dependencies || format('Symfony {0}', matrix.symfony) }}${{ (matrix.note && format(' ({0})', matrix.note)) || '' }}
run: |
unset SYMFONY_REQUIRE
composer global require php-coveralls/php-coveralls
php-coveralls -v --coverage_clover "build/logs/clover*.xml"