forked from phiamo/MopaBootstrapBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (79 loc) · 2.59 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
84
85
86
87
88
89
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: '7.2'
coverage: 'none'
extensions: 'json, mbstring, tokenizer'
tools: 'composer-normalize, php-cs-fixer:2.18.6'
- 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=false'
- 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 }}, Twig ${{ matrix.twig }})'
timeout-minutes: 10
strategy:
matrix:
php:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
symfony:
- '5.*'
twig:
- '3.*'
composer_flags:
- '--no-scripts --prefer-dist --prefer-stable'
include:
- php: '7.2'
symfony: '4.4.*'
twig: '2.*'
composer_flags: '--no-scripts --prefer-dist --prefer-lowest'
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 global require --no-progress --no-scripts --no-plugins symfony/flex
composer update --no-interaction --no-progress --ansi ${{ matrix.composer_flags }}
- name: 'Run unit tests'
run: |
vendor/bin/phpunit