-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (62 loc) · 2.3 KB
/
continuous-integration.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
name: "CI"
on:
push:
pull_request:
env:
fail-fast: true
jobs:
phpunit:
name: "PHPUnit"
runs-on: "ubuntu-20.04"
strategy:
matrix:
include:
- php-version: 7.4
composer-flags: "--prefer-stable"
symfony-require: "3.4.*"
- php-version: 8.0
composer-flags: "--prefer-stable"
symfony-require: "3.4.*"
# When adding support for Symfony4, restore these comments
# - php-version: 7.4
# composer-flags: "--prefer-stable"
# symfony-require: "4.4.*"
# coverage: yes
# When adding support PHP8.0, restore these comments
# - php-version: 8.0
# composer-flags: "--prefer-stable"
# symfony-require: "4.4.*"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
with:
fetch-depth: 2
- name: "Install PHP with XDebug"
uses: "shivammathur/setup-php@v2"
if: "${{ matrix.coverage != '' }}"
with:
php-version: "${{ matrix.php-version }}"
coverage: "xdebug"
- name: "Install PHP without coverage"
uses: "shivammathur/setup-php@v2"
if: "${{ matrix.coverage == '' }}"
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-symfony-${{ matrix.symfony-require }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-symfony-${{ matrix.symfony-require }}-composer-locked-"
- name: "Install dependencies with composer"
run: "composer update --with=symfony/symfony:${{ matrix.symfony-require }} --no-interaction --no-progress ${{ matrix.composer-flags }}"
- name: "Run PHPUnit"
if: "${{ matrix.coverage != '' }}"
run: |
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover=coverage.clover
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
- name: "Run PHPUnit"
if: "${{ matrix.coverage == '' }}"
run: "vendor/bin/phpunit "