-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (72 loc) · 2.73 KB
/
ci.yaml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 8 * * *'
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
name: Coding Standards
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
tools: php-cs-fixer, cs2pr
- name: PHP Coding Standards Fixer (src)
run: php-cs-fixer fix --dry-run --format checkstyle | cs2pr
- name: PHP Coding Standards Fixer (tests)
run: php-cs-fixer fix --config .php-cs-fixer.test.dist.php --dry-run --format checkstyle | cs2pr
phpstan:
runs-on: ubuntu-latest
name: Static Analysis
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
tools: phpstan
- name: Install dependencies
uses: ramsey/composer-install@v2
with:
composer-options: '--prefer-dist'
- name: PHPStan
run: phpstan analyse --no-progress
phpunit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.0', '8.1' ]
phpunit: [ '8.5', '9.5' ]
dependencies: [ 'highest', 'lowest' ]
name: PHP ${{ matrix.php }} & PHPUnit ${{ matrix.phpunit }}${{ matrix.dependencies == 'lowest' && ' (lowest)' || '' }} Test
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: zend.exception_ignore_args=false
- name: Require PHPUnit version
run: composer require --dev phpunit/phpunit:^${{ matrix.phpunit }} --no-update
- name: Install dependencies
uses: ramsey/composer-install@v2
with:
composer-options: '--prefer-dist'
dependency-versions: ${{ matrix.dependencies }}
- name: Run tests
run: vendor/bin/phpunit -v --coverage-text --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
if: ${{ success() }}
uses: codecov/codecov-action@v3
with:
file: coverage.xml
flags: ${{ matrix.php }}