-
-
Notifications
You must be signed in to change notification settings - Fork 72
150 lines (133 loc) · 7.08 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
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'
XDEBUG_MODE: 'coverage'
jobs:
tests:
name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- '8.1'
- '8.2'
dependencies: [ highest ]
variant: [ normal ]
include:
- php-version: '8.1'
dependencies: highest
variant: 'symfony/symfony:"^5.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:4.4-bionic
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 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@v2
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: "--prefer-dist --prefer-stable"
# 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
run: composer bin doctrine update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Install doctrine Composer bin dependencies
run: composer bin doctrine update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Repeat "Install doctrine Composer bin dependencies"
run: composer bin doctrine_mongodb update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Install MongoDB Composer bin dependencies
run: composer bin doctrine_mongodb update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Repeat "Install MongoDB Composer bin dependencies"
run: composer bin doctrine_mongodb update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Install Doctrine PHPCR Composer bin dependencies
run: composer bin doctrine_phpcr update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Repeat "Install Doctrine PHPCR Composer bin dependencies"
run: composer bin doctrine_phpcr update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Install Eloquent Composer bin dependencies
run: composer bin eloquent update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Repeat "Install Eloquent Composer bin dependencies"
run: composer bin eloquent update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
# 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
run: composer bin proxy-manager remove --dev symfony/symfony --no-update
- name: Install ProxyManager Composer bin dependencies
run: composer bin proxy-manager update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Repeat "Install ProxyManager Composer bin dependencies"
run: composer bin proxy-manager update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Add back Symfony for ProxyManager Composer bin dependencies
if: matrix.variant == 'normal'
run: composer bin proxy-manager require --dev "symfony/symfony:^5.4.1 || ^6.0.0" --prefer-dist --prefer-stable ${{ matrix.composer-flags }} --no-update
- name: Add back Symfony (variant) for ProxyManager Composer bin dependencies
if: matrix.variant != 'normal'
run: composer bin proxy-manager require --dev ${{ matrix.variant }} --prefer-dist --prefer-stable ${{ matrix.composer-flags }} --no-update
- name: Install Symfony for ProxyManager Composer bin dependencies
run: composer bin proxy-manager update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Configure Symfony (variant) Composer bin dependencies
if: matrix.variant != 'normal'
run: composer bin symfony require --dev --no-update ${{ matrix.variant }}
- name: Install Symfony Composer bin dependencies
run: composer bin symfony update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Repeat "Install Symfony Composer bin dependencies"
run: composer bin symfony update --prefer-dist --prefer-stable ${{ matrix.composer-flags }}
- name: Run Tests
run: make test
timeout-minutes: 5
# 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