-
-
Notifications
You must be signed in to change notification settings - Fork 18
179 lines (148 loc) · 5.39 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
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
name: Unit Tests MySQL
on:
push:
branches:
- main
pull_request:
concurrency:
group: tests-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches
cancel-in-progress: true
jobs:
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
#- php-version: "7.4"
# db-image: 'mysql:8.0'
# reflector: "pdo-mysql"
# mode: "recording"
# dependencies: "lowest"
- php-version: "7.4"
db-image: 'mysql:8.0'
reflector: "pdo-mysql"
mode: "recording"
dependencies: "highest"
- php-version: "8.0"
db-image: 'mysql:8.0'
reflector: "pdo-mysql"
mode: "recording"
dependencies: "highest"
- php-version: "8.0"
db-image: 'mysql:8.0'
reflector: "mysqli"
mode: "recording"
dependencies: "highest"
- php-version: "8.1"
db-image: 'mysql:8.0'
reflector: "mysqli"
mode: "recording"
dependencies: "highest"
- php-version: '8.1'
db-image: 'mariadb:latest'
reflector: "mysqli"
mode: "recording"
dependencies: "highest"
- php-version: "8.2"
db-image: 'mysql:8.0'
reflector: "mysqli"
mode: "recording"
dependencies: "highest"
- php-version: '8.2'
db-image: 'mariadb:latest'
reflector: "mysqli"
mode: "recording"
dependencies: "highest"
- php-version: "8.1"
db-image: 'mysql:8.0'
reflector: "pdo-mysql"
mode: "replay-and-recording"
dependencies: "highest"
- php-version: "8.1"
db-image: 'mysql:8.0'
reflector: "pdo-mysql"
mode: "empty-recording"
dependencies: "highest"
- php-version: "8.1"
db-image: 'mysql:8.0'
reflector: "pdo-mysql"
mode: "empty-replay-and-recording"
dependencies: "highest"
env:
DBA_REFLECTOR: ${{ matrix.reflector }}
DBA_MODE: ${{ matrix.mode }}
# https://docs.github.com/en/free-pro-team@latest/actions/guides/about-service-containers
services:
database:
image: ${{ matrix.db-image }}
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: ${{ startsWith(matrix.db-image, 'mariadb') && '--health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=1s --health-timeout=10s --health-retries=60' || '--health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3' }}
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.ref }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: none
- uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"
# ignore php8.2 requirement error https://github.com/sebastianbergmann/phpunit/issues/5033
composer-options: "--ignore-platform-req=php+"
- name: Install sqlftw/sqlftw (optional dependency)
run: composer require sqlftw/sqlftw --ignore-platform-req=php+
- name: Install doctrine/dbal (optional dependency)
run: composer require doctrine/dbal:^3 --ignore-platform-req=php+
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Lint
run: composer exec -- parallel-lint --colors src/ tests/
- name: Setup mysql
run: |
mysql -uroot -h127.0.0.1 -proot < tests/schema.sql
- run: composer run phpunit -- --colors=always
replay:
name: PHPUnit (reflection replay)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php-version: "8.1"
reflector: "pdo-mysql"
mode: "replay"
- php-version: "8.1"
reflector: "mysqli"
mode: "replay"
env:
DBA_REFLECTOR: ${{ matrix.reflector }}
DBA_MODE: ${{ matrix.mode }}
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.ref }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: none
- uses: "ramsey/composer-install@v3"
with:
# ignore php8.2 requirement error https://github.com/sebastianbergmann/phpunit/issues/5033
composer-options: "--ignore-platform-req=php+"
- name: Install sqlftw/sqlftw (optional dependency)
run: composer require sqlftw/sqlftw --ignore-platform-req=php+
- name: Install doctrine/dbal (optional dependency)
run: composer require doctrine/dbal:^3 --ignore-platform-req=php+
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- run: composer run phpunit -- --colors=always