-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (49 loc) · 1.36 KB
/
code-quality.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
name: "Code Quality"
on:
push:
branches:
- main
paths-ignore:
- .editorconfig
pull_request:
branches:
- main
paths-ignore:
- .editorconfig
types:
- opened
- synchronize
- ready_for_review
permissions:
contents: read
jobs:
quality:
name: "Code Quality (PHP${{matrix.php_versions}})"
strategy:
matrix:
php_versions: ['7.4', '8.0', '8.1', '8.2', '8.3']
fail-fast: true
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP${{matrix.php_versions}}
uses: shivammathur/setup-php@v2
with:
php-version: ${{matrix.php_versions}}
tools: composer, cs2pr, phpcs, infection:0.26.19
- name: Get Composer cache directory
id: composer-cache
run: echo "composer_cache_dir=$(composer config cache-files-dir)" >> $GITHUB_ENV
- name: Install Dependencies
run: composer install -n -o
- name: Coding Standards (PSR-12)
run: phpcs --standard=PSR12 --report=checkstyle ./src/ | cs2pr
- name: Static Analysis (Psalm)
run: ./vendor/bin/psalm
- name: Unit Tests
run: ./vendor/bin/phpunit
- name: Mutation Tests
if: matrix.php_versions != '7.4'
run: infection run -c infection.dist.json