Skip to content

Commit 66c834e

Browse files
authored
Merge pull request #103 from alexsoft/github-actions
Add GitHub actions
2 parents 2cedb10 + 7baf0e7 commit 66c834e

File tree

5 files changed

+68
-26
lines changed

5 files changed

+68
-26
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
/phpunit.xml.dist export-ignore
99
/.scrutinizer.yml export-ignore
1010
/tests export-ignore
11+
/.github export-ignore

.github/workflows/coverage.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Unit test coverage
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
tests:
9+
runs-on: ubuntu-latest
10+
name: Unit test coverage
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: 8.0
20+
tools: composer:v2
21+
coverage: pcov
22+
23+
- name: Install dependencies
24+
run: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
25+
26+
- name: Execute tests
27+
run: vendor/bin/phpunit --verbose --coverage-text --coverage-clover=coverage.clover
28+
29+
- name: Send coverage to Scrutinizer
30+
run: |
31+
wget https://scrutinizer-ci.com/ocular.phar
32+
php ocular.phar code-coverage:upload --format=php-clover coverage.clover

.github/workflows/tests.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: PHPUnit tests
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
tests:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: true
12+
matrix:
13+
php: [7.1, 7.2, 7.3, 7.4, 8.0]
14+
stability: [prefer-lowest, prefer-stable]
15+
16+
name: Tests on PHP ${{ matrix.php }} - ${{ matrix.stability }}
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php }}
26+
tools: composer:v2
27+
coverage: none
28+
29+
- name: Install dependencies
30+
run: composer update --${{ matrix.stability }} --prefer-source --no-interaction --no-progress
31+
32+
- name: Execute tests
33+
run: vendor/bin/phpunit --verbose

.travis.yml

-23
This file was deleted.

composer.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
"require-dev": {
2929
"mockery/mockery": "^1.3",
30-
"phpunit/phpunit": "^7.0 || ^8.0"
30+
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
3131
},
3232
"autoload": {
3333
"psr-4": {
@@ -40,8 +40,7 @@
4040
}
4141
},
4242
"scripts": {
43-
"test": "phpunit",
44-
"test:coverage": "phpunit --coverage-text --coverage-clover=coverage.clover"
43+
"test": "phpunit"
4544
},
4645
"config": {
4746
"sort-packages": true

0 commit comments

Comments
 (0)