-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 2.14 KB
/
phpunit-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
68
69
name: PHPUnit Test Coverage
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
runs-on: ubuntu-22.04
steps:
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v4
# https://github.com/marketplace/actions/setup-php-action
- name: Setup PHP and disable opcache
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: |
composer install --prefer-dist --no-progress --no-suggest
composer require phpunit/phpunit
- name: Run test suite
env:
XDEBUG_MODE: coverage
run: vendor/bin/phpunit
# The Coveralls repo token is found on the project's Settings page
- name: Upload to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERALLS_RUN_LOCALLY: yes
run: |
composer require 'php-coveralls/php-coveralls:2.5.2'
vendor/bin/php-coveralls \
--coverage_clover ./coverage.xml \
--json_path ./coveralls-upload.json \
--verbose
- name: Upload coverage to Codecov
# https://github.com/marketplace/actions/codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false
files: ./coverage.xml
verbose: true
# The Code Climate Test Coverage Reporter ID can be found by visiting the project's
# Repo Settings pane, click Test Coverage in the left sidebar. Find the ID in the
# second section.
- name: Code Climate coverage
# https://github.com/marketplace/actions/code-climate-coverage-action
uses: paambaati/codeclimate-action@v5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
debug: true
coverageLocations: |
coverage.xml:clover