@@ -11,6 +11,66 @@ on: # yamllint disable-line rule:truthy
1111 - main
1212
1313jobs :
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+ 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 }}
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
0 commit comments