-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (66 loc) · 2.11 KB
/
tests.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI
on:
push:
pull_request:
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
tests:
name: Tests (PHPUnit ${{ matrix.phpunit }}, PHP ${{ matrix.php }})
runs-on: Ubuntu-20.04
strategy:
matrix:
include:
- php: '5.6'
phpunit: '4.8.36'
- php: '5.6'
phpunit: '5.7.27'
- php: '7.4'
phpunit: '6.5.14'
- php: '7.4'
phpunit: '7.5.20'
- php: '7.4'
phpunit: '8.1.6'
- php: '7.4'
phpunit: '8.5.36'
- php: '7.4'
phpunit: '9.6.16'
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "xdebug"
php-version: "${{ matrix.php }}"
tools: phpunit:"${{ matrix.phpunit }}"
- name: Install dependencies
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
composer-options: "--no-dev"
- name: Run tests
run: |
TESTS_COMMAND="phpunit -v --coverage-clover=coverage.clover" php tests/run_tests.php
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload Coverage to Scrutinizer CI (PHP < 8.0)
if: "${{ matrix.php < '8.0' }}"
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --repository=g/console-helpers/phpunit-compat --format=php-clover coverage.clover
- name: Upload Coverage to Scrutinizer CI (PHP >= 8.0)
if: "${{ matrix.php >= '8.0' }}"
run: |
composer require scrutinizer/ocular
vendor/bin/ocular code-coverage:upload --repository=g/console-helpers/phpunit-compat --format=php-clover coverage.clover