Skip to content

Commit 292f90b

Browse files
committed
CS fix
1 parent 8e53961 commit 292f90b

File tree

3 files changed

+67
-6
lines changed

3 files changed

+67
-6
lines changed

.github/workflows/testing.yml

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,66 @@ on: # yamllint disable-line rule:truthy
1111
- main
1212

1313
jobs:
14+
code-coverage:
15+
timeout-minutes: 4
16+
runs-on: ${{ matrix.os }}
17+
concurrency:
18+
cancel-in-progress: true
19+
group: code-coverage-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}-${{ matrix.dependencies }}
20+
strategy:
21+
fail-fast: true
22+
matrix:
23+
os:
24+
- ubuntu-latest
25+
php-version:
26+
- '8.2'
27+
dependencies:
28+
- locked
29+
steps:
30+
- name: 📦 Check out the codebase
31+
uses: actions/checkout@v4
32+
33+
- name: 🛠️ Setup PHP
34+
uses: shivammathur/[email protected]
35+
with:
36+
php-version: ${{ matrix.php-version }}
37+
extensions: none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets, opcache, pcntl, posix
38+
ini-values: error_reporting=E_ALL
39+
coverage: xdebug
40+
41+
- name: 🛠️ Setup problem matchers
42+
run: |
43+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
44+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
45+
46+
- name: 🤖 Validate composer.json and composer.lock
47+
run: composer validate --ansi --strict
48+
49+
- name: 🔍 Get composer cache directory
50+
uses: wayofdev/gh-actions/actions/composer/[email protected]
51+
52+
- name: ♻️ Restore cached dependencies installed with composer
53+
uses: actions/cache@v4
54+
with:
55+
path: ${{ env.COMPOSER_CACHE_DIR }}
56+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
57+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
58+
59+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies
60+
uses: wayofdev/gh-actions/actions/composer/[email protected]
61+
with:
62+
dependencies: ${{ matrix.dependencies }}
63+
64+
- name: 🧪 Collect code coverage with Xdebug and pestphp/pest
65+
run: composer test:cc
66+
67+
- name: 📤 Upload code coverage report to Codecov
68+
uses: codecov/[email protected]
69+
with:
70+
files: .build/phpunit/logs/clover.xml
71+
token: ${{ secrets.CODECOV_TOKEN }}
72+
verbose: true
73+
1474
testing:
1575
timeout-minutes: 4
1676
runs-on: ${{ matrix.os }}
@@ -73,7 +133,4 @@ jobs:
73133
dependencies: ${{ matrix.dependencies }}
74134

75135
- name: 🧪 Run unit tests using phpunit/phpunit
76-
run: composer test
77-
78-
- name: 🧪 Run arch tests using pestphp/pest
79-
run: composer test:arch
136+
run: composer test

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ docs
99
vendor
1010
node_modules
1111
.php-cs-fixer.cache
12-
.context
12+
.context
13+
runtime

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@
5555
"refactor": "rector process --config=rector.php",
5656
"refactor:ci": "rector process --config=rector.php --dry-run --ansi",
5757
"test": "vendor/bin/phpunit",
58-
"test-coverage": "vendor/bin/phpunit --coverage"
58+
"test:cc": [
59+
"@putenv XDEBUG_MODE=coverage",
60+
"phpunit --coverage-clover=.build/phpunit/logs/clover.xml --color=always"
61+
]
5962
},
6063
"minimum-stability": "dev",
6164
"prefer-stable": true

0 commit comments

Comments
 (0)