-
Notifications
You must be signed in to change notification settings - Fork 59
60 lines (60 loc) · 2.35 KB
/
ci.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
name: CI
on:
push:
branches:
- master
paths-ignore:
- "**/*.md"
- "LICENSE"
pull_request:
jobs:
test:
name: Zipkin PHP (PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ["7.4", "8.0", "8.1"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug #optional
extensions: mysql
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
- name: Run lint
if: matrix.operating-system != 'windows-latest'
run: composer lint
- name: Run static check
run: composer static-check
- name: Run tests
run: composer test -- --coverage-clover=build/logs/clover.xml
- name: Upload coverage report to codecov service
if: ${{ matrix.operating-system == 'ubuntu-latest' && matrix.php-versions == '8.0' }}
run: |
wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v2.4.3/php-coveralls.phar
chmod +x php-coveralls.phar
php php-coveralls.phar --version
mkdir -p build/logs
php php-coveralls.phar -v
bash <(curl -s https://codecov.io/bash)
env:
# Running coveralls with default config did not work so followed the workaround below:
# https://github.com/php-coveralls/php-coveralls/issues/273#issuecomment-537473525
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}