-
Notifications
You must be signed in to change notification settings - Fork 59
67 lines (58 loc) · 1.84 KB
/
coverage.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
name: coverage
on:
push:
branches: [ master ]
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
coverage:
runs-on: 'ubuntu-latest'
strategy:
matrix:
php: ['7.4']
name: PHP ${{ matrix.php }} - 'ubuntu-latest' - 'prefer-stable'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
extensions:
gd
pcov
coverage: pcov
- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: "~/.composer/cache"
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-
- name: Setup Problem Matches
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install PHP dependencies
run: composer update --'prefer-stable' --no-interaction --no-progress
- name: Coverage
run: composer coverage
if: "matrix.php == 7.4"
- uses: codecov/codecov-action@v1
with:
files: ./tests/_output/coverage.xml
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)