Skip to content

Commit dcadb25

Browse files
authored
Fix Composer usage in Unit Tests MySQL workflow (#621)
1 parent b5ebeae commit dcadb25

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

.github/workflows/tests.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,72 +24,72 @@ jobs:
2424
db-image: 'mysql:5.7'
2525
reflector: "pdo-mysql"
2626
mode: "recording"
27-
composer-options: "--prefer-lowest"
27+
dependencies: "lowest"
2828

2929
- php-version: "7.2"
3030
db-image: 'mysql:5.7'
3131
reflector: "pdo-mysql"
3232
mode: "recording"
33-
composer-options: "--prefer-dist"
33+
dependencies: "highest"
3434
- php-version: "7.3"
3535
db-image: 'mysql:5.7'
3636
reflector: "pdo-mysql"
3737
mode: "recording"
38-
composer-options: "--prefer-dist"
38+
dependencies: "highest"
3939
- php-version: "7.4"
4040
db-image: 'mysql:8.0'
4141
reflector: "pdo-mysql"
4242
mode: "recording"
43-
composer-options: "--prefer-dist"
43+
dependencies: "highest"
4444
- php-version: "8.0"
4545
db-image: 'mysql:8.0'
4646
reflector: "pdo-mysql"
4747
mode: "recording"
48-
composer-options: "--prefer-dist"
48+
dependencies: "highest"
4949
- php-version: "8.0"
5050
db-image: 'mysql:8.0'
5151
reflector: "mysqli"
5252
mode: "recording"
53-
composer-options: "--prefer-dist"
53+
dependencies: "highest"
5454

5555
- php-version: "8.1"
5656
db-image: 'mysql:8.0'
5757
reflector: "mysqli"
5858
mode: "recording"
59-
composer-options: "--prefer-dist"
59+
dependencies: "highest"
6060
- php-version: '8.1'
6161
db-image: 'mariadb:latest'
6262
reflector: "mysqli"
6363
mode: "recording"
64-
composer-options: "--prefer-dist"
64+
dependencies: "highest"
6565

6666
- php-version: "8.2"
6767
db-image: 'mysql:8.0'
6868
reflector: "mysqli"
6969
mode: "recording"
70-
composer-options: "--prefer-dist"
70+
dependencies: "highest"
7171
- php-version: '8.2'
7272
db-image: 'mariadb:latest'
7373
reflector: "mysqli"
7474
mode: "recording"
75-
composer-options: "--prefer-dist"
75+
dependencies: "highest"
7676

7777
- php-version: "8.1"
7878
db-image: 'mysql:8.0'
7979
reflector: "pdo-mysql"
8080
mode: "replay-and-recording"
81-
composer-options: "--prefer-dist"
81+
dependencies: "highest"
8282

8383
- php-version: "8.1"
8484
db-image: 'mysql:8.0'
8585
reflector: "pdo-mysql"
8686
mode: "empty-recording"
87-
composer-options: "--prefer-dist"
87+
dependencies: "highest"
8888
- php-version: "8.1"
8989
db-image: 'mysql:8.0'
9090
reflector: "pdo-mysql"
9191
mode: "empty-replay-and-recording"
92-
composer-options: "--prefer-dist"
92+
dependencies: "highest"
9393

9494
env:
9595
DBA_REFLECTOR: ${{ matrix.reflector }}
@@ -119,8 +119,9 @@ jobs:
119119

120120
- uses: "ramsey/composer-install@v2"
121121
with:
122+
dependency-versions: "${{ matrix.dependencies }}"
122123
# ignore php8.2 requirement error https://github.com/sebastianbergmann/phpunit/issues/5033
123-
composer-options: "${{matrix.composer-options}} --no-progress --ignore-platform-req=php+"
124+
composer-options: "--ignore-platform-req=php+"
124125

125126
- name: Install sqlftw/sqlftw (optional dependency)
126127
run: composer require sqlftw/sqlftw --ignore-platform-req=php+
@@ -134,13 +135,13 @@ jobs:
134135
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
135136

136137
- name: Lint
137-
run: php vendor/bin/parallel-lint --colors src tests
138+
run: composer exec -- parallel-lint --colors src/ tests/
138139

139140
- name: Setup mysql
140141
run: |
141142
mysql -uroot -h127.0.0.1 -proot < tests/schema.sql
142143
143-
- run: composer phpunit -- --colors=always
144+
- run: composer run phpunit -- --colors=always
144145

145146
replay:
146147
name: PHPUnit (reflection replay)
@@ -176,7 +177,7 @@ jobs:
176177
- uses: "ramsey/composer-install@v2"
177178
with:
178179
# ignore php8.2 requirement error https://github.com/sebastianbergmann/phpunit/issues/5033
179-
composer-options: "--prefer-dist --no-progress --ignore-platform-req=php+"
180+
composer-options: "--ignore-platform-req=php+"
180181

181182
- name: Install sqlftw/sqlftw (optional dependency)
182183
run: composer require sqlftw/sqlftw --ignore-platform-req=php+
@@ -189,4 +190,4 @@ jobs:
189190
- name: Setup Problem Matchers for PHPUnit
190191
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
191192

192-
- run: composer phpunit -- --colors=always
193+
- run: composer run phpunit -- --colors=always

0 commit comments

Comments
 (0)