Skip to content

Commit 8ea2f90

Browse files
committed
ci: Add unit testing workflow and update .gitattributes
1 parent 93068c4 commit 8ea2f90

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ Dockerfile export-ignore
1212
infection.* export-ignore
1313
tests export-ignore
1414
docs export-ignore
15+
resources export-ignore

.github/workflows/testing.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
3+
name: 🧪 Unit testing
4+
5+
on: # yamllint disable-line rule:truthy
6+
pull_request:
7+
branches:
8+
- 1.x
9+
push:
10+
branches:
11+
- 1.x
12+
13+
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@v5
32+
33+
- name: 🛠️ Setup PHP
34+
uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: ${{ matrix.php-version }}
37+
ini-values: error_reporting=E_ALL
38+
coverage: xdebug
39+
40+
- name: 🛠️ Setup problem matchers
41+
run: |
42+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
43+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
44+
45+
- name: 🤖 Validate composer.json and composer.lock
46+
run: composer validate --ansi --strict
47+
48+
- name: 📥 Install dependencies with composer
49+
uses: ramsey/composer-install@v3
50+
with:
51+
dependency-versions: ${{ matrix.dependencies }}
52+
53+
- name: 🧪 Collect code coverage with Xdebug and PhpUnit
54+
run: composer test:cc
55+
56+
- name: 📤 Upload code coverage report to Codecov
57+
uses: codecov/codecov-action@v4
58+
with:
59+
files: runtime/phpunit/logs/clover.xml
60+
token: ${{ secrets.CODECOV_TOKEN }}
61+
verbose: true
62+
63+
testing:
64+
timeout-minutes: 4
65+
runs-on: ${{ matrix.os }}
66+
concurrency:
67+
cancel-in-progress: true
68+
group: testing-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}-${{ matrix.dependencies }}
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
os:
73+
- ubuntu-latest
74+
php-version:
75+
- '8.1'
76+
- '8.2'
77+
- '8.3'
78+
- '8.4'
79+
dependencies:
80+
- lowest
81+
- locked
82+
- highest
83+
steps:
84+
- name: 📦 Check out the codebase
85+
uses: actions/checkout@v5
86+
87+
- name: 🛠️ Setup PHP
88+
uses: shivammathur/setup-php@v2
89+
with:
90+
php-version: ${{ matrix.php-version }}
91+
ini-values: error_reporting=E_ALL
92+
93+
- name: 🛠️ Setup problem matchers
94+
run: |
95+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
96+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
97+
98+
- name: 🤖 Validate composer.json and composer.lock
99+
run: composer validate --ansi --strict
100+
101+
- name: 📥 Install dependencies with composer
102+
uses: ramsey/composer-install@v3
103+
with:
104+
dependency-versions: ${{ matrix.dependencies }}
105+
106+
- name: 🧪 Run tests
107+
run: composer test

0 commit comments

Comments
 (0)