-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (43 loc) · 1.7 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Tests
on: [push, pull_request]
env:
CC_TEST_REPORTER_ID: a9ab6de7fbc8f532a9f829091d3994223dfbef5542c42f5c6d5e3ec877eebc74
jobs:
phpunit:
name: PHP ${{ matrix.php }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ['8.0', '8.1', '8.2', '8.3']
steps:
## checkout the repoistory
- name: Checkout Repo
uses: actions/checkout@v3
## Install(?) php
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, dom, intl, mbstring, mcrypt, mysql, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, sqlite
ini-values: date.timezone='UTC',error_reporting=E_ALL,display_errors=On
## install composer
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader
## run unit tests
- name: PHP Unit tests for PHP
run: vendor/bin/phpunit --verbose --configuration actions.phpunit.xml
if: matrix.php == '8.3' || matrix.php == '8.2' || matrix.php == '8.1'
## unit test with coverage
- name: PHP Unit tests for PHP 8.0
run: vendor/bin/phpunit --verbose --coverage-clover=clover.xml --configuration actions.phpunit.xml
if: matrix.php == '8.0'
## coverage
- name: Code coverage
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter after-build -t clover
if: matrix.php == '8.0'
continue-on-error: true # if is fork