Skip to content

Commit c00a5c1

Browse files
committed
Setup GitHub workflow
1 parent a6cda12 commit c00a5c1

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/run-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: [ push, pull_request ]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: true
10+
matrix:
11+
php: [ 8.0, 8.1 ]
12+
laravel: [ 8.* ]
13+
dependency-version: [ prefer-stable ]
14+
include:
15+
- laravel: 5.7.*
16+
php: 7.2
17+
testbench: 3.7.*
18+
- laravel: 5.8.*
19+
php: 7.2
20+
testbench: 3.8.*
21+
- laravel: 6.*
22+
php: 7.2
23+
testbench: 4.*
24+
- laravel: 6.*
25+
php: 8.0
26+
testbench: 4.*
27+
- laravel: 7.*
28+
php: 7.2
29+
testbench: 5.*
30+
- laravel: 7.*
31+
php: 8.0
32+
testbench: 5.*
33+
- laravel: 8.*
34+
php: 7.3
35+
testbench: 6.*
36+
- laravel: 8.*
37+
testbench: 6.*
38+
- laravel: 9.*
39+
testbench: 7.*
40+
41+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
42+
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v2
46+
47+
- name: Cache dependencies
48+
uses: actions/cache@v2
49+
with:
50+
path: ~/.composer/cache/files
51+
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
52+
53+
- name: Setup PHP
54+
uses: shivammathur/setup-php@v2
55+
with:
56+
php-version: ${{ matrix.php }}
57+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
58+
coverage: xdebug
59+
60+
- name: Install dependencies
61+
run: composer update --with="illuminate/support:${{ matrix.laravel }}" --with="orchestra/testbench:${{ matrix.testbench }}" --prefer-dist --no-interaction --no-progress
62+
63+
- name: Execute tests
64+
run: vendor/bin/phpunit --coverage-clover=coverage.xml
65+
66+
- if: github.event_name == 'push'
67+
name: Run Codacy Coverage Reporter
68+
uses: codacy/codacy-coverage-reporter-action@master
69+
with:
70+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
71+
coverage-reports: coverage.xml

0 commit comments

Comments
 (0)