Skip to content

Commit c633548

Browse files
author
Six
committed
Added GitHub Actions CI workflow
1 parent 2d2cd72 commit c633548

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
php-version: ['8.3']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php-version }}
24+
extensions: gmp, xdebug
25+
coverage: xdebug
26+
27+
- name: Install dependencies
28+
run: composer install --prefer-dist --no-progress
29+
30+
- name: Run PHPStan
31+
run: composer stan
32+
33+
- name: Run tests with coverage
34+
run: composer coverage
35+
36+
- name: Upload coverage to Codecov
37+
uses: codecov/codecov-action@v3
38+
with:
39+
file: ./coverage.xml
40+
fail_ci_if_error: true

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# blibio/combinatorics
22

33
[![Software License][badge-license]][license]
4+
[![Coverage Status][badge-coverage]][coverage]
45

56
Simple PHP 8.3+ [generators][] to create:
67

@@ -41,4 +42,6 @@ The blibio/combinatorics library is copyright © Stephan Six and licensed for us
4142
[combinations]: https://en.wikipedia.org/wiki/Combination
4243
[permutations]: https://en.wikipedia.org/wiki/Permutation
4344
[badge-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
44-
[license]: https://github.com/blibio/combinatorics/blob/main/LICENSE
45+
[badge-coverage]: https://codecov.io/gh/blibio/combinatorics/branch/main/graph/badge.svg
46+
[license]: https://github.com/blibio/combinatorics/blob/main/LICENSE
47+
[coverage]: https://codecov.io/gh/blibio/combinatorics

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"scripts": {
5151
"test": "phpunit",
5252
"stan": "phpstan analyse",
53-
"coverage": "XDEBUG_MODE=coverage phpunit --coverage-html coverage-html --coverage-text",
53+
"coverage": "XDEBUG_MODE=coverage phpunit --coverage-html coverage-html --coverage-text --coverage-clover coverage.xml",
5454
"coverage-text": "XDEBUG_MODE=coverage phpunit --coverage-text",
5555
"cs-fix": "php-cs-fixer fix",
5656
"cs-check": "php-cs-fixer fix --dry-run --diff"

0 commit comments

Comments
 (0)