Skip to content

Commit c7cac96

Browse files
committed
Separate job for running tests on PHP 7.4 and 8.0
1 parent 3a16e85 commit c7cac96

File tree

3 files changed

+45
-13
lines changed

3 files changed

+45
-13
lines changed

.github/workflows/tests.yml

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ jobs:
3232
fail-fast: false
3333
matrix:
3434
php-version:
35-
- "7.4"
36-
- "8.0"
3735
- "8.1"
3836
- "8.2"
3937
- "8.3"
@@ -57,15 +55,6 @@ jobs:
5755
- name: "Install dependencies"
5856
run: "composer install --no-interaction --no-progress"
5957

60-
- name: "Transform source code"
61-
if: matrix.php-version != '8.1' && matrix.php-version != '8.2' && matrix.php-version != '8.3' && matrix.php-version != '8.4'
62-
shell: bash
63-
run: |
64-
composer install --no-interaction --no-progress --working-dir=compiler
65-
./compiler/vendor/bin/simple-downgrade downgrade -c build/downgrade.php ${{ matrix.php-version }}
66-
composer dump
67-
68-
6958
- name: "Tests"
7059
run: "make tests"
7160

@@ -158,3 +147,46 @@ jobs:
158147

159148
- name: "Tests"
160149
run: "${{ matrix.script }}"
150+
151+
tests-with-old-phpunit:
152+
name: "Tests with old PHPUnit"
153+
runs-on: ${{ matrix.operating-system }}
154+
timeout-minutes: 60
155+
156+
strategy:
157+
fail-fast: false
158+
matrix:
159+
php-version:
160+
- "7.4"
161+
- "8.0"
162+
operating-system: [ ubuntu-latest, windows-latest ]
163+
164+
steps:
165+
- name: "Checkout"
166+
uses: actions/checkout@v4
167+
168+
- name: "Install PHP"
169+
uses: "shivammathur/setup-php@v2"
170+
with:
171+
coverage: "none"
172+
php-version: "${{ matrix.php-version }}"
173+
tools: pecl
174+
extensions: ds,mbstring
175+
ini-file: development
176+
ini-values: memory_limit=2G
177+
178+
- name: "Install dependencies"
179+
run: "composer install --no-interaction --no-progress"
180+
181+
- name: "Downgrade PHPUnit"
182+
run: "composer require --dev phpunit/phpunit:^9.6 --update-with-dependencies"
183+
184+
- name: "Transform source code"
185+
shell: bash
186+
run: |
187+
composer install --no-interaction --no-progress --working-dir=compiler
188+
./compiler/vendor/bin/simple-downgrade downgrade -c build/downgrade.php ${{ matrix.php-version }}
189+
composer dump
190+
191+
- name: "Tests"
192+
run: "make tests-coverage"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"phpstan/phpstan-nette": "^2.0",
6262
"phpstan/phpstan-phpunit": "^2.0.7",
6363
"phpstan/phpstan-strict-rules": "^2.0",
64-
"phpunit/phpunit": "^9.6 || ^10.5",
64+
"phpunit/phpunit": "^10.5",
6565
"shipmonk/composer-dependency-analyser": "^1.5",
6666
"shipmonk/dead-code-detector": "^0.12.0",
6767
"shipmonk/name-collision-detector": "^2.0"

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)