-
Notifications
You must be signed in to change notification settings - Fork 31
62 lines (49 loc) · 1.96 KB
/
Copy pathcode_coverage.yml
File metadata and controls
62 lines (49 loc) · 1.96 KB
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
name: PHPUnit Code Coverage
on:
pull_request:
workflow_dispatch:
# Cancel all previous workflow runs for the same branch that have not yet completed.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
run:
runs-on: ${{ matrix.operating-system }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4']
wp-versions: ['latest']
name: Code Coverage.
env:
IMAGIFY_TESTS_API_KEY: ${{ secrets.IMAGIFY_TESTS_API_KEY }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup PHP + Composer
uses: wp-media/workflows/.github/actions/setup-php-composer@main
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
# Empty overrides the action's `--no-scripts` default so Composer runs
# post-install/update scripts, i.e. Strauss namespace prefixing, which the
# covered unit suite needs to autoload the Imagify\Dependencies\* classes.
composer-options: ''
# Registered here, not in the composite action: GitHub removes problem
# matchers added inside a composite action when it finishes, so they must
# be added in the caller to stay active for the test steps below.
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Code Coverage
run: composer code-coverage
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699 # v1.3.0
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: tests/report/coverage.clover