-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (53 loc) · 2.18 KB
/
unit-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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: UnitTests
on: [push, pull_request]
jobs:
tests:
name: "PHP${{ matrix.php }} ${{ matrix.composer-flags }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php: '7.1'
coverage: 'xdebug'
composer-flags: '--prefer-lowest'
- php: '7.2'
- php: '7.3'
- php: '7.4'
- php: '8.0'
coverage: 'pcov'
- php: '8.1'
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: PHP setup
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: ${{ matrix.coverage || 'none' }}
- name: Update composer dependencies
run: composer update -o --no-interaction --no-progress ${{ matrix.composer-flags }}
- name: Run test suite
run: mkdir -p var/build && ./vendor/bin/phpunit -v --coverage-clover var/build/clover.xml
- name: Install php-coveralls
run: composer global require -o --no-interaction --no-progress php-coveralls/php-coveralls
- name: Upload coverage results to Coveralls
if: matrix.coverage
uses: nick-invision/retry@v2
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: "PHP${{ matrix.php }}"
with:
timeout_seconds: 60
max_attempts: 3
command: php-coveralls -x var/build/clover.xml -o var/build/upload.json -v
coveralls-finish:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Notify Coveralls when build is finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true