1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build-test:
7
+ runs-on: ${{ matrix.os }}
8
+
9
+ env:
10
+ PHP_EXTENSIONS: json
11
+ PHP_INI_VALUES: assert.exception=1, zend.assertions=1
12
+
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os:
17
+ - ubuntu-latest
18
+ - windows-latest
19
+ php-version:
20
+ - 7.1
21
+ - 7.4
22
+ phpunit-version:
23
+ - 7.5.20
24
+ dependencies:
25
+ - lowest
26
+ - highest
27
+ name: PHPUnit Tests
28
+ steps:
29
+ - name: Configure git to avoid issues with line endings
30
+ if: matrix.os == 'windows-latest'
31
+ run: git config --global core.autocrlf false
32
+ - name: Checkout
33
+ uses: actions/checkout@v2
34
+ - name: Setup PHP
35
+ uses: shivammathur/setup-php@v2
36
+ with:
37
+ php-version: ${{ matrix.php-version }}
38
+ tools: composer:v5, phpunit:${{ matrix.phpunit-versions }}
39
+ coverage: xdebug
40
+ extensions: ${{ env.PHP_EXTENSIONS }}
41
+ ini-values: ${{ env.PHP_INI_VALUES }}
42
+ - name: Get composer cache directory
43
+ id: composer-cache
44
+ run: echo "::set-output name=dir::$(composer config cache-files-dir)"
45
+ - name: Cache dependencies
46
+ uses: actions/cache@v2
47
+ with:
48
+ path: ${{ steps.composer-cache.outputs.dir }}
49
+ key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
50
+ restore-keys: |
51
+ php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
52
+ - name: Install lowest dependencies with composer
53
+ if: matrix.dependencies == 'lowest'
54
+ run: composer update --no-ansi --no-interaction --no-progress --prefer-lowest
55
+ - name: Install highest dependencies with composer
56
+ if: matrix.dependencies == 'highest'
57
+ run: composer update --no-ansi --no-interaction --no-progress
58
+ - name: Run tests with phpunit
59
+ run: composer test
0 commit comments