Skip to content

Commit 9199dc4

Browse files
committed
feat(github): setup actions for tetsting and coverage
Signed-off-by: Fred Myerscough <oniice@gmail.com>
1 parent b6c0ae7 commit 9199dc4

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

.github/workflows/codecov.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Code Coverage
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
push:
7+
branches: [ main ]
8+
9+
jobs:
10+
run:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ ubuntu-latest ]
15+
php-versions: [ 8.3 ]
16+
17+
name: PHP ${{ matrix.php-versions }} - ${{ matrix.os }}
18+
steps:
19+
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php-versions }}
27+
coverage: xdebug
28+
29+
- name: Install dependencies
30+
run: composer install --prefer-dist --no-progress --no-interaction
31+
32+
- name: Run Test Suite
33+
run: vendor/bin/phpunit --testdox --coverage-clover ./coverage.xml
34+
35+
- name: Code Coverage
36+
uses: codecov/codecov-action@v4
37+
with:
38+
token: ${{ secrets.CODECOV_TOKEN }}
39+
files: ./coverage.xml
40+
verbose: true

.github/workflows/tests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Tests
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
push:
7+
branches: [ main, develop ]
8+
pull_request:
9+
branches: [ main, develop ]
10+
11+
jobs:
12+
run:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
php-versions: [ 8.2, 8.3 ]
18+
19+
name: PHP ${{ matrix.php-versions }} - ${{ matrix.os }}
20+
steps:
21+
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php-versions }}
29+
coverage: xdebug
30+
31+
- name: Install dependencies
32+
run: composer install --prefer-dist --no-progress --no-interaction
33+
34+
- name: Run Test Suite
35+
run: composer run test

0 commit comments

Comments
 (0)