Skip to content

Commit d27d781

Browse files
Added actions config
1 parent 0dabb25 commit d27d781

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/tests.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
tests:
9+
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
14+
15+
name: PHP ${{ matrix.php }}
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php }}
25+
extensions: curl
26+
tools: composer:v2
27+
coverage: none
28+
29+
- name: Install PHP 7 dependencies
30+
run: composer update --prefer-dist --no-interaction --no-progress
31+
if: "matrix.php != '8.0'"
32+
33+
- name: Install PHP 8 dependencies
34+
run: composer update --prefer-dist --no-interaction --no-progress --ignore-platform-reqs
35+
if: "matrix.php == '8.0'"
36+
37+
- name: Execute tests
38+
run: composer test
39+
40+
coverage:
41+
tests:
42+
43+
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
47+
48+
name: Code Coverage
49+
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v2
53+
54+
- name: Setup PHP
55+
uses: shivammathur/setup-php@v2
56+
with:
57+
php-version: 7.4
58+
extensions: curl
59+
tools: composer:v2
60+
coverage: xdebug
61+
62+
- name: Install dependencies
63+
run: composer update --prefer-dist --no-interaction --no-progress
64+
65+
- name: Execute tests
66+
run: composer test-ci
67+
68+
- name: Upload coverage
69+
run: |
70+
wget https://scrutinizer-ci.com/ocular.phar; fi
71+
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml

0 commit comments

Comments
 (0)