-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (46 loc) · 1.34 KB
/
tests.yaml
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
name: Test
on: [push, pull_request]
env:
COVERAGE: '0'
jobs:
tests:
name: Tests (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
include:
- php: '8.0'
coverage: true
steps:
- uses: actions/checkout@master
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-ansi --no-progress
- name: Enable code coverage
if: matrix.coverage
run: echo "COVERAGE=1" >> $GITHUB_ENV
- name: PHPUnit
run: |
mkdir -p build/logs/phpunit
if [ "$COVERAGE" = '1' ]; then
vendor/bin/phpunit --log-junit build/logs/phpunit/junit.xml --coverage-clover build/logs/phpunit/clover.xml
else
vendor/bin/phpunit --log-junit build/logs/phpunit/junit.xml
fi
- name: Upload coverage results to Codecov
if: matrix.coverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: phpunit-php${{ matrix.php }}
flags: phpunit
fail_ci_if_error: false
continue-on-error: true