Skip to content

Commit c31a620

Browse files
committed
Setup GitHub workflow
1 parent f384069 commit c31a620

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/run-tests.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Tests
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
test:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: true
10+
matrix:
11+
os: [ ubuntu-latest ]
12+
php: [ 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 ]
13+
dependency-version: [ prefer-stable ]
14+
15+
name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Cache dependencies
22+
uses: actions/cache@v2
23+
with:
24+
path: ~/.composer/cache/files
25+
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php }}
31+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
32+
coverage: pcov
33+
34+
- name: Install dependencies
35+
run: |
36+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
37+
38+
- name: Execute tests
39+
run: vendor/bin/phpunit --coverage-clover=coverage.xml
40+
41+
- if: github.event_name == 'push'
42+
name: Run Codacy Coverage Reporter
43+
uses: codacy/codacy-coverage-reporter-action@master
44+
with:
45+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
46+
coverage-reports: coverage.xml

0 commit comments

Comments
 (0)