-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (86 loc) · 3.48 KB
/
phpunit.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
name: PHPUnit
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
name: "PHP ${{ matrix.php }} - Symfony ${{ matrix.symfony }}"
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.can-fail }}
strategy:
fail-fast: false
matrix:
include:
# Lowest Deps 5.4
- php: 8.0
symfony: 5.4.*
coverage: 'none'
composer-flags: '--prefer-stable --prefer-lowest'
can-fail: false
# LTS with latest stable PHP 5.4
- php: latest
symfony: 5.4.*
coverage: 'none'
composer-flags: '--prefer-stable'
can-fail: false
# LTS with latest stable PHP 6.4
- php: latest
symfony: 6.4.*
coverage: 'none'
composer-flags: '--prefer-stable'
can-fail: false
# Active release
- php: latest
symfony: 7.0.*
coverage: pcov
composer-flags: '--prefer-stable'
can-fail: false
# Development release
- php: nightly
symfony: 7.1.*@dev
coverage: 'none'
composer-flags: ''
can-fail: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2, flex
coverage: ${{ matrix.coverage }}
ini-values: date.timezone=UTC,memory_limit=-1,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1
env:
fail-fast: true
- name: Set Composer stability
if: matrix.php == 'nightly'
run: "composer config minimum-stability dev"
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-
- name: Install Composer dependencies
run: composer update ${{ matrix.composer-flags }} --no-interaction --no-progress --optimize-autoloader
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}
- name: Run tests
run: composer test
- name: Monitor coverage
if: matrix.coverage != 'none'
uses: slavcodev/coverage-monitor-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
coverage_path: coverage-report.xml
threshold_alert: 60
threshold_warning: 80