-
Notifications
You must be signed in to change notification settings - Fork 76
48 lines (39 loc) · 1.46 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
name: "Unit Tests"
on:
pull_request:
push:
branches:
- master
jobs:
tests:
runs-on: ${{ matrix.os }}
env:
PHP_EXTENSIONS: none, bcmath, ctype, curl, dom, json, gmp, mbstring, opcache, simplexml, sockets, tokenizer, xml, xmlwriter
PHP_INI_VALUES: memory_limit=-1, assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.1, 8.2, 8.3]
dependency-version: [prefer-lowest, prefer-stable]
name: Tests PHP${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
steps:
- uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: ${{ matrix.coverage-driver }}
extensions: ${{ env.PHP_EXTENSIONS }}
ini-values: ${{ env.PHP_INI_VALUES }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Composer dependencies
run: composer update --${{ matrix.dependency-version }} --no-ansi --no-interaction --no-progress --prefer-dist
- name: Run unit tests with PHPUnit
run: composer run test:unit