forked from portphp/doctrine
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.54 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
name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
strategy:
matrix:
php-versions: [ '7.4', '8.0', '8.1' ]
include:
- php-versions: '7.4'
coverage: pcov
composer-prefer: '--prefer-lowest --prefer-stable'
phpunit-flags: '--coverage-clover coverage.xml'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: ${{ matrix.coverage }}
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-composer-${{ matrix.composer-prefer }}$-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.composer-prefer }}-
- name: Install dependencies
run: composer update --prefer-dist --no-progress --ignore-platform-req="ext-*" ${{ matrix.composer-prefer }}
- name: Run test suite
run: vendor/bin/phpunit ${{ matrix.phpunit-flags }}
- name: Upload coverage
if: matrix.coverage
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}