-
-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (63 loc) · 2.3 KB
/
continuous-integration.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
name: "Continuous Integration"
on:
push:
paths-ignore:
- 'doc/**'
pull_request:
paths-ignore:
- 'doc/**'
jobs:
phpunit:
name: PHP ${{ matrix.php-version }} (${{ matrix.dependency-version }})
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php-version:
- "7.4"
- "8.0"
dependency-version: [prefer-lowest, prefer-stable]
experimental: [false]
include:
- php-version: "8.1"
dependency-version: "prefer-lowest"
experimental: true
- php-version: "8.1"
dependency-version: "prefer-lowest"
experimental: true
steps:
- uses: actions/[email protected]
- name: Setup PHP with PECL extension
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: pcov
- name: Validate composer.json and composer.lock
run: composer validate
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer packages
uses: actions/[email protected]
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-
- name: Install dependencies (PHP 7)
if: steps.composer-cache.outputs.cache-hit != 'true' && matrix.php-version < 8
run: composer update --${{ matrix.dependency-version }} --no-progress --no-interaction
- name: Install dependencies (PHP 8)
if: steps.composer-cache.outputs.cache-hit != 'true' && matrix.php-version >= 8
run: composer update --${{ matrix.dependency-version }} --ignore-platform-req=php --no-progress --no-interaction
- name: Run PHPUnit test suite
run: composer run-script test-ci
- name: Publish code coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: composer run-script test-coverage
coverageLocations: |
${{github.workspace}}/clover.xml:clover