Skip to content

Commit 2ad93f1

Browse files
committed
featI(github): added actions to run tests and generate coverage badges
Signed-off-by: Fred Myerscough <[email protected]>
1 parent 932736f commit 2ad93f1

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

.github/workflows/codecov.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: codecov
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+
extensions: intl, fileinfo
29+
30+
- name: Install dependencies
31+
run: composer install --prefer-dist --no-progress --no-interaction
32+
33+
- name: Run Test Suite
34+
run: vendor/bin/phpunit --testdox --coverage-clover ./coverage.xml
35+
36+
- name: Code Coverage
37+
uses: codecov/codecov-action@v4
38+
with:
39+
token: ${{ secrets.CODECOV_TOKEN }}
40+
files: ./coverage.xml
41+
verbose: true

.github/workflows/php.yml

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

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ a package to help build queries with Eloquent Builder from URL parameters in a r
44
[![Latest Stable Version](https://poser.pugx.org/myerscode/laravel-query-strategies/v/stable)](https://packagist.org/packages/myerscode/laravel-query-strategies)
55
[![Total Downloads](https://poser.pugx.org/myerscode/laravel-query-strategies/downloads)](https://packagist.org/packages/myerscode/laravel-query-strategies)
66
[![License](https://poser.pugx.org/myerscode/laravel-query-strategies/license)](https://packagist.org/packages/myerscode/laravel-query-strategies)
7+
![Tests](https://github.com/myerscode/laravel-query-strategies/actions/workflows/tests.yml/badge.svg?branch=main)
8+
[![codecov](https://codecov.io/gh/myerscode/laravel-query-strategies/graph/badge.svg?token=YR0YHVERNV)](https://codecov.io/gh/myerscode/utilities-strings)
79

810
## Why this package is helpful?
911
If you want to apply query clauses to Eloquent Models using parameters passed by the user, then this package will allow you to create strategies that will enable them to be applied automatically.

0 commit comments

Comments
 (0)