-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (56 loc) · 2.16 KB
/
code-coverage.yml
File metadata and controls
62 lines (56 loc) · 2.16 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: "Code coverage"
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
php-version:
description: "The PHP version to use when running the job"
default: "8.0"
required: false
type: "string"
php-extensions:
description: "The php extensions to install, allowing composer to pass"
default: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo"
required: false
type: "string"
composer-root-version:
description: "The version of the package being tested, in case of circular dependencies."
required: false
type: "string"
composer-options:
description: "Additional flags for the composer install command."
default: "--prefer-dist"
required: false
type: "string"
composer-dependencies:
description: "Composer dependency level to install"
default: "locked"
required: false
type: "string"
jobs:
code-coverage:
name: "Code Coverage"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v6"
- name: "Set up PHP"
uses: "shivammathur/[email protected]"
with:
coverage: "xdebug"
extensions: "${{ inputs.php-extensions }}"
php-version: "${{ inputs.php-version }}"
- name: "Set COMPOSER_ROOT_VERSION"
run: |
echo "COMPOSER_ROOT_VERSION=${{ inputs.composer-root-version }}" >> $GITHUB_ENV
if: "${{ inputs.composer-root-version }}"
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ inputs.composer-dependencies }}"
composer-options: "${{ inputs.composer-options }}"
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m") # yamllint disable-line rule:quoted-strings
- name: "Collect code coverage with Xdebug and phpunit/phpunit"
env:
XDEBUG_MODE: "coverage"
run: "vendor/bin/phpunit --colors=always --coverage-clover=.build/phpunit/logs/clover.xml"