-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (52 loc) · 1.79 KB
/
php.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.2', '8.3' ]
phpunit-versions: ['11.0']
include:
- php-versions: '8.1'
phpunit-versions: '10.0'
steps:
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer,phive
coverage: xdebug
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- uses: actions/checkout@v2
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress
- name: Install tools
run: phive --no-progress install --trust-gpg-keys 4AA394086372C20A,12CE0F1D262429A5 phpunit@^${{ matrix.phpunit-versions }} psalm
- name: Run test suite
run: tools/phpunit --coverage-clover build/coverage.xml
- name: Run static analysis
run: tools/psalm -- --output-format=github --shepherd
- uses: codecov/codecov-action@v1
with:
file: ./build/coverage.xml
flags: unit,integration
fail_ci_if_error: true