-
Notifications
You must be signed in to change notification settings - Fork 16
118 lines (101 loc) · 3.79 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: "Continuous Integration"
on: [push, pull_request]
jobs:
test:
name: "CI"
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
composer-version: ["v2"]
phpdotenv-version: ["^4.1", "^5.2"]
include:
- php-version: "7.1"
composer-version: "v1"
phpdotenv-version: "^4.1"
- php-version: "7.1"
composer-version: "v1"
phpdotenv-version: "^5.2"
- php-version: "7.4"
composer-version: "v1"
phpdotenv-version: "^5.2"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
tools: "composer:${{ matrix.composer-version }}"
coverage: "xdebug"
- name: "Choose Composer 1 version"
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "composer/composer:^1.0" --dev --no-update --no-interaction
if: "matrix.composer-version == 'v1'"
- name: "Choose PHPUnit version"
run: |
if [ "${{ matrix.php-version }}" = "7.1" ]; then
echo "SYMFONY_PHPUNIT_VERSION=7.5" >> $GITHUB_ENV;
elif [ "${{ matrix.php-version }}" = "8.0" ]; then
echo "SYMFONY_PHPUNIT_VERSION=9.4" >> $GITHUB_ENV;
else
echo "SYMFONY_PHPUNIT_VERSION=8.5" >> $GITHUB_ENV;
fi
- name: "Choose PHP Dotenv version"
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "vlucas/phpdotenv:${{ matrix.phpdotenv-version }}" --no-update --no-interaction
- name: Install PHP 7 dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --prefer-dist --no-interaction --no-progress
if: "matrix.php-version < 8"
- name: Install PHP 8 dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --prefer-dist --no-interaction --no-progress --ignore-platform-req=php
if: "matrix.php-version >= 8"
- name: "Run PHP_CodeSniffer"
run: "composer cs-check"
if: "matrix.composer-version == 'v2' && matrix.php-version == '7.4'"
- name: "Run unit test suite and collect coverage data"
run: "composer test-unit-coverage"
if: "matrix.composer-version == 'v1' || matrix.php-version == '7.4'"
- name: "Run unit test suite"
run: "composer test-unit"
if: "matrix.composer-version != 'v1' && matrix.php-version != '7.4'"
- name: "Run integration test suite"
run: "composer test-integration"
- name: "Upload intermediate results to Coveralls"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: php-${{ matrix.php-version }}_composer-${{ matrix.composer-version }}_phpdotenv-${{ matrix.phpdotenv-version }}
COVERALLS_PARALLEL: true
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=clover.xml --json_path coveralls-upload.json -v
if: "matrix.composer-version == 'v1' || matrix.php-version == '7.4'"
finish:
name: "Coverage"
needs: test
runs-on: ubuntu-latest
steps:
- name: "Merge intermediate results and finalize Coveralls report"
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true