-
Notifications
You must be signed in to change notification settings - Fork 468
90 lines (87 loc) · 2.82 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
86
87
88
89
90
name: "Continuous Integration"
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist"
COVERAGE_FLAGS: "--coverage-text --coverage-clover build/logs/clover.xml"
SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT: "1"
jobs:
tests:
name: PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "5.3"
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
include:
- php-version: 8.1
coverage: coverage
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 10
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: dom
coverage: xdebug
env:
update: true
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ matrix.php-version }}-composer-
- name: Install Composer
uses: nick-invision/retry@v1
with:
timeout_minutes: 10
max_attempts: 3
command: composer update ${{ env.COMPOSER_FLAGS }}
- name: composer validate
run: composer validate --strict
- name: Test with phpunit (with coverage)
id: phpunit-coverage
if: "matrix.coverage == 'coverage'"
run: ./phpunit --verbose ${{ env.COVERAGE_FLAGS }}
- name: Test with phpunit (without coverage)
if: "matrix.coverage != 'coverage'"
run: ./phpunit --verbose
- name: Submit Coveralls
if: steps.phpunit-coverage.outcome == 'success'
uses: nick-invision/retry@v1
with:
timeout_minutes: 10
max_attempts: 3
command: |
[[ -f vendor/bin/php-coveralls ]] && COVERALLS_PATH=vendor/bin/php-coveralls || COVERALLS_PATH=vendor/bin/coveralls
[[ -n $COVERALLS_REPO_TOKEN ]] && php $COVERALLS_PATH -v --exclude-no-stmt || true
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}