-
-
Notifications
You must be signed in to change notification settings - Fork 6
64 lines (54 loc) · 1.82 KB
/
test.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
name: Tests
on:
push:
branches:
- "master"
pull_request_target:
jobs:
build:
permissions:
id-token: write
contents: read
env:
COMPOSER_ROOT_VERSION: dev-master
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
php_version:
- '8.1'
- '8.2'
- '8.3'
composer_flags:
- ''
- '-o'
name: 'PHP ${{ matrix.php_version }} (composer_flags: "${{ matrix.composer_flags }}")'
steps:
- uses: actions/checkout@v4
- name: Setup PHP with pecl extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: :opcache, pcov
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
composer-options: ${{ matrix.composer_flags }}
- name: Install Composer dependencies (tests)
run: php tests/install-deps.php
env:
COMPOSER_FLAGS: ${{ matrix.composer_flags }}
- run: vendor/bin/phpunit
if: ${{ matrix.php_version != '8.2' }}
- run: vendor/bin/phpunit --coverage-clover coverage.xml
if: ${{ matrix.php_version == '8.2' }}
env:
XDEBUG_MODE: coverage
- name: Upload coverage to Codecov
if: ${{ matrix.php_version == '8.2' }}
uses: codecov/codecov-action@v4
with:
use_oidc: true
file: ./coverage.xml