1
1
name : CI
2
- on : [push, pull_request]
2
+ on :
3
+ push :
4
+ branches :
5
+ - master
6
+ paths-ignore :
7
+ - " **/*.md"
8
+ - " LICENSE"
9
+ pull_request :
3
10
jobs :
4
11
test :
5
12
name : Zipkin PHP (PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
8
15
fail-fast : false
9
16
matrix :
10
17
operating-system : [ubuntu-latest, windows-latest, macos-latest]
11
- php-versions : [' 7.1', ' 7.2', ' 7.3', ' 7.4' ]
18
+ php-versions : [" 7.1", " 7.2", " 7.3", " 7.4" ]
12
19
steps :
13
20
- name : Checkout
14
21
uses : actions/checkout@v2
15
22
- name : Setup PHP, with composer and extensions
16
23
uses : shivammathur/setup-php@v2 # https://github.com/shivammathur/setup-php
17
24
with :
18
25
php-version : ${{ matrix.php-versions }}
19
- extensions : mbstring, xml, ctype, iconv, intl, pdo_sqlite
20
26
coverage : xdebug # optional
21
27
- name : Get composer cache directory
22
28
id : composer-cache
@@ -25,29 +31,32 @@ jobs:
25
31
uses : actions/cache@v2
26
32
with :
27
33
path : ${{ steps.composer-cache.outputs.dir }}
28
- # Use composer.json for key, if composer.lock is not committed.
29
- # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
30
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
34
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
31
35
restore-keys : ${{ runner.os }}-composer-
32
36
- name : Install Composer dependencies
33
37
run : |
34
38
composer install --no-progress --prefer-dist --optimize-autoloader
35
- - name : Download coveralls.phar
36
- if : matrix.operating-system != 'windows -latest'
39
+ - name : Download php- coveralls.phar
40
+ if : matrix.operating-system == 'ubuntu -latest'
37
41
run : |
38
- wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/ coveralls.phar
39
- chmod +x coveralls.phar
40
- php coveralls.phar --version
42
+ wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v2.4.2/php- coveralls.phar
43
+ chmod +x php- coveralls.phar
44
+ php php- coveralls.phar --version
41
45
mkdir -p build/logs
42
- - name : Run Lint
46
+ - name : Run lint
43
47
if : matrix.operating-system != 'windows-latest'
44
48
run : composer lint
45
- - name : Run Static check
49
+ - name : Run static check
46
50
run : composer static-check
47
- - name : Run Tests
51
+ - name : Run tests
48
52
run : composer test -- --coverage-clover=build/logs/clover.xml
49
53
- name : Upload coverage report to codecov service
50
- if : matrix.operating-system != 'windows -latest'
54
+ if : matrix.operating-system == 'ubuntu -latest'
51
55
run : |
52
- php coveralls.phar -v
56
+ php php- coveralls.phar -v
53
57
bash <(curl -s https://codecov.io/bash)
58
+ env :
59
+ # Running coveralls with default config did not work so followed the workaround below:
60
+ # https://github.com/php-coveralls/php-coveralls/issues/273#issuecomment-537473525
61
+ COVERALLS_RUN_LOCALLY : 1
62
+ COVERALLS_REPO_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}
0 commit comments