-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (88 loc) · 2.66 KB
/
Copy pathci.yml
File metadata and controls
110 lines (88 loc) · 2.66 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
109
110
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: PHPUnit (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
steps:
- uses: actions/checkout@v4
- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, json, mbstring
tools: composer:v2
coverage: none
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: composer-${{ matrix.php }}-${{ hashFiles('composer.json') }}
restore-keys: composer-${{ matrix.php }}-
- name: Validate composer.json
run: composer validate --strict
- name: Install dependencies
run: composer install --no-progress --prefer-dist --no-interaction
- name: Run PHPUnit
run: vendor/bin/phpunit
coverage:
name: Coverage
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up PHP 8.3 (with pcov)
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: curl, json, mbstring
tools: composer:v2
coverage: pcov
- run: composer install --no-progress --prefer-dist --no-interaction
- name: Run PHPUnit with coverage
run: vendor/bin/phpunit --coverage-clover coverage.xml
- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
static-analysis:
name: PHPStan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer:v2
coverage: none
- run: composer install --no-progress --prefer-dist --no-interaction
- name: Run PHPStan
run: vendor/bin/phpstan analyse --no-progress
code-style:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer:v2
coverage: none
- run: composer install --no-progress --prefer-dist --no-interaction
- name: Check code style
run: vendor/bin/php-cs-fixer fix --dry-run --diff --no-interaction