-
Notifications
You must be signed in to change notification settings - Fork 4
85 lines (70 loc) · 2.78 KB
/
ci.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
name: "CI Tests"
on:
pull_request:
push:
env:
fail-fast: true
PHPUNIT_FLAGS: "-v"
jobs:
check-cs:
name: Check Coding Standards
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Composer
uses: php-actions/composer@v6
- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --diff --dry-run --allow-risky yes
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.can-fail }}
name: PHP v${{ matrix.php }}, Symfony v${{ matrix.symfony }} ${{ matrix.composer_flag }}
strategy:
matrix:
include:
- { os: ubuntu-20.04, php: 7.2, symfony: "5.4.*", composer-flags: "--prefer-stable --prefer-lowest", can-fail: false }
- { os: ubuntu-latest, php: 8.3, symfony: "6.4.*", composer-flags: "--prefer-stable", can-fail: false }
- { os: ubuntu-latest, php: 8.2, symfony: "6.3.*", composer-flags: "--prefer-stable", can-fail: false }
- { os: ubuntu-latest, php: 8.2, symfony: "6.4.*", composer-flags: "--prefer-stable", can-fail: false }
- { os: ubuntu-latest, php: 8.3, symfony: "7.0.*", composer-flags: "--prefer-stable", can-fail: false }
steps:
- uses: actions/checkout@v3
- name: "Installing php"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl,mbstring,xdebug
ini-values: date.timezone="Europe/Paris"
coverage: xdebug
tools: composer
- name: Show PHP version
run: php -v && composer -V
- name: Download Composer cache dependencies from cache
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: ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ matrix.os }}-composer-
- name: Set Composer stability
if: matrix.symfony == '6.3.*@dev'
run: composer config minimum-stability dev
- name: Fix PSR container compatibility
if: |
matrix.symfony == '5.4.*'
&& endsWith(matrix.composer_flag, 'prefer-lowest')
run: composer require psr/container:^1.1
- name: Silence Symfony deprecation helper for lower deps
if: endsWith(matrix.composer-flags, 'prefer-lowest')
run: echo "SYMFONY_DEPRECATIONS_HELPER=weak" >> $GITHUB_ENV
- name: Install dependencies
run: composer update ${{ matrix.composer-flags }} --prefer-dist
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
- name: Run PHPUnit Tests
run: composer test