-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (63 loc) · 3.02 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
name: Continuous integration
on:
pull_request: ~
workflow_dispatch: ~
release:
types: [created]
schedule:
- cron: 0 2 * * 1,4 # At 2am on Monday & Thursday
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
symfony: [5.4.*, 6.0.*, none]
php: [8.0, 8.1, 8.2]
lowest: ['', '--prefer-lowest']
name: 🚧 Build 🚧 | PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }} lowest ${{ matrix.lowest }}
steps:
# --- ⚙️ Setup ⚙️ ----------
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
env:
COMPOSER_TOKEN: ${{ secrets.PAT }}
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-
${{ runner.os }}-php
- name: Restrict Symfony version
if: matrix.symfony != 'none'
run: composer config extra.symfony.require "${{ matrix.symfony }}"
- name: Install dependencies
run: composer update ${{ matrix.lowest }} --no-interaction --no-progress --prefer-dist --ansi --verbose --no-scripts
# --- 🛠 Test 🛠 ----------
- name: Validate composer.json and composer.lock
run: composer validate --strict --no-interaction --ansi --verbose
- name: Check for dump in code
run: vendor/bin/var-dump-check --symfony --exclude vendor --exclude tests .
- name: PHPStan analyse
run: vendor/bin/phpstan analyse --configuration=phpstan-ci.neon --error-format=github --no-progress --no-interaction --ansi
- name: ECS check
run: vendor/bin/ecs check --no-progress-bar --no-interaction --ansi
- name: PHPUnit tests
run: vendor/bin/phpunit --verbose --coverage-clover ./coverage.xml --coverage-text --color=always --fail-on-incomplete --fail-on-risky --no-interaction --do-not-cache-result
- name: Coverage check
id: coverage-check
uses: johanvanhelden/gha-clover-test-coverage-check@v1
with:
percentage: 98
filename: coverage.xml