-
-
Notifications
You must be signed in to change notification settings - Fork 71
218 lines (198 loc) · 9.61 KB
/
tests.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
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: Tests
on:
pull_request: null
push:
branches: [ master, main ]
schedule:
# Do not make it the first of the month and/or midnight since it is a very busy time
- cron: "* 10 5 * *"
# this fixes the input device is not a TTY .. see https://github.com/docker/compose/issues/5696
env:
MYSQL_HOST: '127.0.0.1'
DOCTRINE_ORM_DB_HOST: '127.0.0.1'
MONGO_DB_VERSION: '7.0'
XDEBUG_MODE: 'coverage'
jobs:
tests:
name: '${{ matrix.make-test }}: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }}'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- '8.3'
dependencies: [ highest, lowest ]
make-test:
- test_core
- test_doctrine_bridge
- test_doctrine_odm_bridge
- test_doctrine_phpcr_bridge
- test_eloquent_bridge
- test_symfony_bridge
- test_symfony_doctrine_bridge
- test_symfony_doctrine_bridge_proxy_manager
- test_symfony_eloquent_bridge
- test_symfony_eloquent_bridge_proxy_manager
variant:
- 'no-change'
- '"symfony/symfony:^6.4"'
# To keep in sync with docker-compose.yml
services:
mysql:
image: mysql:8.0
ports:
- 3307:3306
env:
MYSQL_DATABASE: fidry_alice_data_fixtures
MYSQL_ROOT_USER: root
MYSQL_ROOT_PASSWORD: password
mongo:
image: mongo:7.0
ports:
- 27018:27017
env:
MONGO_INITDB_DATABASE: fidry_alice_data_fixtures
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install mongosh
run: |
sudo apt-get update
sudo apt-get install -y wget gnupg
wget -qO - https://www.mongodb.org/static/pgp/server-${MONGO_DB_VERSION}.asc | sudo apt-key add -
echo \
"deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/${MONGO_DB_VERSION} multiverse" \
| sudo tee /etc/apt/sources.list.d/mongodb-org-${MONGO_DB_VERSION}.list
sudo apt-get update
sudo apt-get install -y mongodb-mongosh
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
tools: composer
extensions: mongodb
- name: Configure
run: |
set -eo pipefail
PHPUNIT_FLAGS='--stop-on-failure --verbose'
perl -pi -e 's/^}$/,"provide":{"ext-mongo":"*"}}/' composer.json
- name: Install Composer dependencies (${{ matrix.dependencies }})
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
# Split the bin updates to avoid GA to time out the task
# The updates apparently need to be repeated as well due to a bug
# in the wiki merge plugin
- name: Install doctrine Composer bin dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/doctrine
- name: Repeat "Install doctrine Composer bin dependencies"
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/doctrine
- name: Install MongoDB Composer bin dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/doctrine_mongodb
- name: Repeat "Install MongoDB Composer bin dependencies"
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/doctrine_mongodb
- name: Install Doctrine PHPCR Composer bin dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/doctrine_phpcr
- name: Repeat "Install Doctrine PHPCR Composer bin dependencies"
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/doctrine_phpcr
- name: Install Eloquent Composer bin dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/eloquent
- name: Repeat "Install Eloquent Composer bin dependencies"
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/eloquent
# There is a known issue here with Composer
# see https://github.com/composer/composer/issues/10200
# Meanwhile we break down the installation as a workaround.
# Once this is fixed the whole bin dependencies can probably be installed
# in one step with a timeout adjustment
- name: Remove Symfony from ProxyManager Composer bin dependencies
if: matrix.variant != 'no-change'
run: composer bin proxy-manager remove --dev --no-update symfony/symfony
- name: Install ProxyManager Composer bin dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/proxy-manager
- name: Repeat "Install ProxyManager Composer bin dependencies"
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/proxy-manager
- name: Add back Symfony (variant) for ProxyManager Composer bin dependencies
if: matrix.variant != 'no-change'
run: composer bin proxy-manager require --dev --no-update ${{ matrix.variant }}
- name: Install Symfony for ProxyManager Composer bin dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/proxy-manager
- name: Configure Symfony (variant) Composer bin dependencies
if: matrix.variant != 'no-change'
run: composer bin symfony require --dev --no-update ${{ matrix.variant }}
- name: Install Symfony Composer bin dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/symfony
- name: Repeat "Install Symfony Composer bin dependencies"
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-flags }}"
working-directory: vendor-bin/symfony
- name: Run Tests
run: make ${{ matrix.make-test }}
# This is a "trick", a meta task which does not change, and we can use in
# the protected branch rules as opposed to the individual tests which
# may change regularly.
validate-tests:
name: Tests status
runs-on: ubuntu-latest
needs:
- tests
if: always()
steps:
- name: Successful run
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing run
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1