-
Notifications
You must be signed in to change notification settings - Fork 347
83 lines (73 loc) · 2.57 KB
/
continuous-integration.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
82
83
name: 'Continuous integration'
on: ['push', 'pull_request']
jobs:
cs:
runs-on: 'ubuntu-20.04'
name: 'Coding style'
steps:
- name: 'Checkout'
uses: 'actions/checkout@v2'
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '8.1'
coverage: 'none'
extensions: 'json, mbstring, tokenizer'
tools: 'composer-normalize, php-cs-fixer:3.11.0'
- name: 'Display tools versions'
run: |
composer-normalize --version
php-cs-fixer --version
- name: 'Check PHP code'
run: 'php-cs-fixer fix --diff --dry-run --allow-risky=yes --using-cache=no'
- name: 'Check composer.json'
run: 'composer-normalize --diff --dry-run --no-update-lock'
if: 'always()'
phpunit:
runs-on: 'ubuntu-20.04'
name: 'PHPUnit (PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }})'
timeout-minutes: 10
strategy:
matrix:
php: ['8.1', '8.0']
symfony: ['6.*', '5.*', '4.*']
include:
- php: '7.2'
symfony: '5.*'
twig: '2.*'
- php: '7.2'
symfony: '4.*'
twig: '2.*'
fail-fast: false
steps:
- name: 'Checkout'
uses: 'actions/checkout@v2'
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php }}'
coverage: 'none'
tools: 'pecl, composer:v2'
extensions: 'curl, json, mbstring, openssl'
- 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@v2'
with:
path: '${{ steps.composer_cache.outputs.dir }}'
key: '${{ runner.os }}-composer-php${{ matrix.php }}-${{ hashFiles(''**/composer.json'') }}'
restore-keys: |
${{ runner.os }}-composer-php${{ matrix.php }}-
${{ runner.os }}-composer-
- name: 'Update dependencies'
env:
SYMFONY_REQUIRE: '${{ matrix.symfony }}'
run: |
composer require --no-progress --no-scripts --no-plugins --no-update symfony/flex
[[ -n "${{ matrix.twig }}" ]] && composer require --no-progress --no-scripts --no-plugins --no-update twig/twig:${{ matrix.twig }} || true
composer update --no-interaction --no-progress --no-scripts --ansi ${{ matrix.composer_flags }}
- name: 'Run unit tests'
run: |
vendor/bin/phpunit