Skip to content

Commit 2424e76

Browse files
committed
test new phpunit build
1 parent e7cae6c commit 2424e76

File tree

1 file changed

+37
-19
lines changed

1 file changed

+37
-19
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,44 @@ jobs:
4545
runs-on: ubuntu-latest
4646
strategy:
4747
matrix:
48-
php-versions: ['7.4', '8.1']
49-
composer-args: ['--prefer-stable', '--prefer-lowest', '']
50-
composer-command: ['install', 'update']
51-
exclude:
52-
- composer-args: '--prefer-stable'
53-
composer-command: 'install'
54-
- composer-args: '--prefer-lowest'
55-
composer-command: 'install'
56-
- composer-args: ''
57-
composer-command: 'update'
48+
php-version: ['7.4', '8.1']
49+
dependencies:
50+
- "lowest"
51+
- "highest"
52+
- "locked"
5853

5954
steps:
60-
- uses: actions/checkout@v2
61-
- uses: php-actions/composer@v5
55+
- name: "Checkout"
56+
uses: "actions/checkout@v3"
57+
58+
- name: "Install PHP"
59+
uses: "shivammathur/setup-php@v2"
6260
with:
63-
php_version: ${{ matrix.php-versions }}
64-
command: ${{ matrix.composer-command }}
65-
args: ${{ matrix.composer-args }}
66-
- name: PHPUnit tests
67-
uses: php-actions/phpunit@v3
61+
coverage: "pcov"
62+
php-version: "${{ matrix.php-version }}"
63+
ini-values: memory_limit=-1
64+
tools: composer:v2, cs2pr
65+
66+
- name: "Cache dependencies"
67+
uses: "actions/cache@v3"
6868
with:
69-
configuration: phpunit.xml
70-
php_version: ${{ matrix.php-versions }}
69+
path: |
70+
~/.composer/cache
71+
vendor
72+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
73+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
74+
75+
- name: "Install lowest dependencies"
76+
if: ${{ matrix.dependencies == 'lowest' }}
77+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest --ignore-platform-req=php"
78+
79+
- name: "Install highest dependencies"
80+
if: ${{ matrix.dependencies == 'highest' }}
81+
run: "composer update --no-interaction --no-progress --no-suggest --ignore-platform-req=php"
82+
83+
- name: "Install locked dependencies"
84+
if: ${{ matrix.dependencies == 'locked' }}
85+
run: "composer install --no-interaction --no-progress --no-suggest --ignore-platform-req=php"
86+
87+
- name: "Tests"
88+
run: "vendor/bin/phpunit"

0 commit comments

Comments
 (0)