-
Notifications
You must be signed in to change notification settings - Fork 30
70 lines (61 loc) · 2.34 KB
/
test.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
name: Test
on:
push: ~
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# Earliest and latest version of each major version
php-versions: ['7.2', '7.4', '8.0', '8.3']
prefer: ['prefer-stable', 'prefer-lowest']
symfony-versions: ['^5.4', '^6', '^7']
include:
- symfony-versions: '^7'
symfony7-required-yaml-version: '^6 || ^7'
exclude:
# Symfony 7 requires at least PHP 8.2
- php-versions: '7.2'
symfony-versions: '^7'
- php-versions: '7.4'
symfony-versions: '^7'
- php-versions: '8.0'
symfony-versions: '^7'
# Symfony 6 requires PHP 8
- php-versions: '7.2'
symfony-versions: '^6'
- php-versions: '7.4'
symfony-versions: '^6'
name: Test PHP ${{ matrix.php-versions }}, Symfony ${{ matrix.symfony-versions }}, ${{ matrix.prefer }}
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
env:
fail-fast: true
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ matrix.symfony-versions }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ matrix.symfony-versions }}-
- name: Install dependencies
run: |
for symfony_package in $(jq -r '.require | keys[]' composer.json | grep '^symfony/'); do
composer require --no-update "${symfony_package}:${{ matrix.symfony-versions }}"
done
if [ -n "${{ matrix.symfony7-required-yaml-version }}" ]; then
composer require --dev --no-update "symfony/yaml:${{ matrix.symfony7-required-yaml-version }}"
fi
composer --prefer-dist --${{ matrix.prefer }} update
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run PHPUnit
run: ./vendor/bin/phpunit