Skip to content

Commit 8a97a01

Browse files
committed
Updated ubuntu and actions in GH workflow
1 parent c53edee commit 8a97a01

File tree

1 file changed

+32
-20
lines changed

1 file changed

+32
-20
lines changed

.github/workflows/phpunit.yml

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,47 @@
11
name: CI-coverage
22

3-
on: [ push ]
3+
on: [ push, pull_request ]
4+
5+
permissions:
6+
contents: read
47

58
jobs:
69
test-php:
7-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-latest
811
strategy:
912
fail-fast: true
1013
matrix:
11-
php-versions: [ "7.4", "8.0", "8.4" ]
12-
phpunit-versions: [ "9" ]
14+
php-version: [ "7.4", "8.0", "8.4" ]
1315
steps:
14-
- uses: actions/checkout@v2
15-
- uses: php-actions/composer@v6
16+
- uses: actions/checkout@v5
17+
18+
- name: Set up PHP
19+
uses: shivammathur/setup-php@v2
1620
with:
17-
php_version: "${{ matrix.php-versions }}"
18-
dev: yes
19-
interaction: no
20-
- name: PHPUnit Tests php
21-
uses: php-actions/phpunit@v2
21+
php-version: "${{ matrix.php-version }}"
22+
extensions: curl, json
23+
coverage: xdebug
24+
tools: composer:v2
25+
ini-values: xdebug.mode=coverage
26+
27+
- name: Validate Composer files
28+
run: composer validate --strict
29+
30+
- name: Install dependencies
31+
uses: ramsey/composer-install@v3
2232
with:
23-
version: "${{ matrix.phpunit-versions }}"
24-
php_version: "${{ matrix.php-versions }}"
25-
php_extensions: xdebug
26-
bootstrap: vendor/autoload.php
27-
configuration: phpunit.xml
28-
args: --coverage-clover=coverage.xml --exclude-group local-only
33+
composer-options: --no-interaction --prefer-dist
34+
35+
- name: Run PHPUnit
36+
run: vendor/bin/phpunit --configuration phpunit.xml --coverage-clover=coverage.xml --exclude-group local-only
2937
env:
3038
XDEBUG_MODE: coverage
31-
- name: Upload to Codecov
32-
uses: codecov/codecov-action@v1
39+
40+
- name: Upload coverage to Codecov
41+
if: matrix.php-version == '8.4'
42+
uses: codecov/codecov-action@v4
3343
with:
3444
token: ${{ secrets.CODECOV_TOKEN }}
35-
file: ./coverage.xml
45+
files: ./coverage.xml
46+
disable_search: true
47+
fail_ci_if_error: true

0 commit comments

Comments
 (0)