-
Notifications
You must be signed in to change notification settings - Fork 158
110 lines (90 loc) · 3.2 KB
/
ci.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: CI
on:
pull_request:
push:
branches:
- "master"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
fail-fast: true
jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: 8.2
- name: "Install Dependencies with Composer"
uses: ramsey/composer-install@v2
- name: "Run PHPStan"
run: |
vendor/bin/simple-phpunit --version
vendor/bin/phpstan analyse --error-format=github
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: 8.1
tools: cs2pr
- name: "Install Dependencies with Composer"
uses: ramsey/composer-install@v2
- name: "Run PHP-CS-Fixer"
run: vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
phpunit:
name: "PHPUnit (PHP ${{ matrix.php-version }}) (Symfony ${{ matrix.symfony-version }})"
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4', '8.1', '8.2', '8.3']
symfony-version: ['5.4', '6.4', '7.0']
exclude:
- php-version: '7.4'
symfony-version: '6.4'
- php-version: '7.4'
symfony-version: '7.0'
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: flex
- name: "Install Dependencies with Composer"
uses: "ramsey/composer-install@v2"
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
with:
composer-options: "--optimize-autoloader"
- name: "Run tests with PHPUnit"
env:
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=2'
run: vendor/bin/simple-phpunit
codecov:
name: "Code coverage"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
coverage: pcov
php-version: 8.2
- name: "Install Dependencies with Composer"
uses: ramsey/composer-install@v2
- name: "Run tests with PHPUnit and collect coverage"
run: php -dpcov.enabled=1 -dpcov.directory=. -dpcov.exclude="~vendor~" vendor/bin/simple-phpunit --colors=always --coverage-text -vvv