-
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (86 loc) · 2.74 KB
/
CI.yaml
File metadata and controls
108 lines (86 loc) · 2.74 KB
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
name: "CI"
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
workflow_dispatch:
permissions:
contents: read
env:
PHP_STABLE_VERSION: '8.4'
jobs:
cs:
name: "Code style"
runs-on: ubuntu-latest
steps:
- name: "Git: checkout"
uses: actions/checkout@v4
- name: "PHP: setup ${{ env.PHP_STABLE_VERSION }}"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_STABLE_VERSION }}
coverage: none
tools: php-cs-fixer
- name: "Composer: validate"
run: composer validate --strict
- name: "Composer: install"
run: composer install --prefer-dist --no-interaction --no-progress
- name: "Php-CS-Fixer: version"
run: php-cs-fixer -V
- name: "Php-CS-Fixer: check"
run: php-cs-fixer fix --diff --dry-run
sa:
name: "Static Analysis"
runs-on: ubuntu-latest
steps:
- name: "Git: checkout"
uses: actions/checkout@v4
- name: "PHP: setup ${{ env.PHP_STABLE_VERSION }}"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_STABLE_VERSION }}
coverage: pcov
tools: phpstan
- name: "Composer: install"
run: composer install --prefer-dist --no-interaction --no-progress
- name: "PHPStan: version"
run: phpstan --version
- name: "PHPStan: analyze"
run: phpstan analyze --memory-limit=-1
tests:
name: "Unit Tests (PHP ${{ matrix.php-version }})"
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.2', '8.3', '8.4', '8.5']
fail-fast: false
steps:
- name: "Git: checkout"
uses: actions/checkout@v4
- name: "PHP: setup ${{ matrix.php-version }}"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: phpunit
# Force PHPUnit 11.5 on PHP 8.2 to keep support for it
# https://phpunit.de/supported-versions.html
- if: matrix.php-version == '8.2'
run: composer require --no-update phpunit/phpunit:^11.5
- name: "Composer: install"
run: composer update --no-interaction --prefer-dist
- name: "PHPUnit: version"
run: phpunit --version
- name: "PHPUnit: tests"
if: matrix.php-version != env.PHP_STABLE_VERSION
run: phpunit
- name: "PHPUnit: tests + coverage"
if: matrix.php-version == env.PHP_STABLE_VERSION
run: phpunit --coverage-clover ./coverage.xml
- name: "Codecov: upload coverage"
if: matrix.php-version == env.PHP_STABLE_VERSION
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
fail_ci_if_error: false