-
Notifications
You must be signed in to change notification settings - Fork 20
58 lines (48 loc) · 1.41 KB
/
unit-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
name: PHPUnit
on:
push:
pull_request:
jobs:
tests:
name: Tests (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: ['ubuntu-latest']
php:
- '8.5'
- '8.4'
- '8.3'
- '8.2'
- '8.1'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup PHP with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php }}
coverage: xdebug
tools: none
- name: "Install Composer dependencies"
if: ${{ matrix.php <= '8.4' }}
uses: "ramsey/composer-install@v2"
- name: "Install Composer dependencies (PHP 8.5)"
if: ${{ matrix.php >= '8.5' }}
uses: "ramsey/composer-install@v2"
with:
composer-options: --ignore-platform-reqs
- name: Run tests
run: composer run phpunit -- --coverage-clover .phpunit.cache/clover.xml
- name: Upload coverage reports to Codecov
if: ${{ success() && matrix.php == '8.4' }}
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./.phpunit.cache/clover.xml
fail_ci_if_error: true
verbose: true