Skip to content

Commit 5a438e0

Browse files
committed
cicd: Add badge and tests workflow
1 parent c727dda commit 5a438e0

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

.github/workflows/badges.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Badges
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
tests:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
php: [ '8.4' ]
20+
21+
name: PHP ${{ matrix.php }}
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php }}
31+
tools: composer:v2
32+
coverage: pcov
33+
34+
- name: Install PHP dependencies
35+
run: composer update --prefer-stable --no-interaction --no-progress --ansi
36+
37+
- name: Code coverage
38+
run: composer run-script test:coverage
39+
40+
- name: Upload coverage reports to Codecov
41+
uses: codecov/codecov-action@v5
42+
with:
43+
directory: tests/coverage
44+
files: tests/coverage/clover.xml
45+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
tests:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
20+
21+
name: PHP ${{ matrix.php }}
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php }}
31+
tools: composer:v2
32+
coverage: pcov
33+
34+
- name: Install PHP dependencies
35+
run: composer update --prefer-stable --no-interaction --no-progress --ansi
36+
37+
- name: Run test suite
38+
run: composer run-script test

0 commit comments

Comments
 (0)