-
-
Notifications
You must be signed in to change notification settings - Fork 86
154 lines (129 loc) · 5.85 KB
/
test-config.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: Package tests
on:
push:
pull_request:
workflow_dispatch:
env:
SWAGGER_VERSION: '3.0'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ '7.3', '8.0.2', '8.1', '8.2' ]
swagger-lume-flags: ['latest', 'lumen-6-swagger-2', 'lumen-7-swagger-2', 'lumen-7-swagger-3', 'lumen-8-swagger-3', 'lumen-9-swagger-3', 'lumen-10-swagger-3', 'lumen-10-swagger-3-ui-4', 'lumen-11-swagger-4', 'lumen-11-swagger-4-ui-4']
name: PHP ${{ matrix.php }} - ${{ matrix.swagger-lume-flags }}
steps:
- uses: actions/checkout@v2
- name: Info
run: |
echo ${{ matrix.php }} - ${{ matrix.swagger-lume-flags }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: xdebug.mode="coverage"
coverage: xdebug
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-swaggerlumer-${{ matrix.swagger-lume-flags }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer update --no-interaction --no-progress --prefer-dist --prefer-stable
- name: Only install swagger 4 before php 8.2
run: |
composer require 'zircote/swagger-php:3.*' --no-interaction
composer require 'doctrine/annotations:1.*' --no-interaction
if: matrix.php != '8.2'
- name: Lumen 6 && Swagger 2
env:
SWAGGER_VERSION: '2.0'
run: |
composer require 'laravel/lumen-framework:6.*' --no-interaction --no-update
composer require 'zircote/swagger-php:2.*' --no-interaction --no-update
if: matrix.php == '7.3' && matrix.swagger-lume-flags == 'lumen-6-swagger-2'
- name: Lumen 7 && Swagger 2
env:
SWAGGER_VERSION: '2.0'
run: |
composer require 'laravel/lumen-framework:7.*' --no-interaction --no-update
composer require 'zircote/swagger-php:2.*' --no-interaction --no-update
if: matrix.php == '7.3' && matrix.swagger-lume-flags == 'lumen-7-swagger-2'
- name: Lumen 7 && Swagger 3
env:
SWAGGER_VERSION: '3.0'
run: |
composer require 'laravel/lumen-framework:7.*' --no-interaction --no-update
composer require 'zircote/swagger-php:3.*' --no-interaction --no-update
if: (matrix.php == '7.3') && matrix.swagger-lume-flags == 'lumen-7-swagger-3'
- name: Lumen 8 && Swagger 3
env:
SWAGGER_VERSION: '3.0'
run: |
composer require 'laravel/lumen-framework:8.*' --no-interaction --no-update
composer require 'zircote/swagger-php:3.*' --no-interaction --no-update
if: (matrix.php == '7.3' || matrix.php == '8.0.2') && matrix.swagger-lume-flags == 'lumen-8-swagger-3'
- name: Lumen 9 && Swagger 3
env:
SWAGGER_VERSION: '3.0'
run: |
composer require 'laravel/lumen-framework:9.*' --no-interaction --no-update
composer require 'zircote/swagger-php:3.*' --no-interaction --no-update
if: matrix.php == '8.0.2' && matrix.swagger-lume-flags == 'lumen-9-swagger-3'
- name: Lumen 10 && Swagger 3
env:
SWAGGER_VERSION: '3.0'
run: |
composer require 'laravel/lumen-framework:10.*' --no-interaction --no-update
composer require 'zircote/swagger-php:3.*' --no-interaction --no-update
if: matrix.php == '8.1' && matrix.swagger-lume-flags == 'lumen-10-swagger-3'
- name: Lumen 10 && Swagger 3 && Swagger-UI 4
env:
SWAGGER_VERSION: '3.0'
run: |
composer require 'laravel/lumen-framework:10.*' --no-interaction --no-update
composer require 'zircote/swagger-php:3.*' --no-interaction --no-update
composer require 'swagger-api/swagger-ui:4.*' --no-interaction --no-update
composer require 'phpunit/phpunit:10.*' --no-interaction --no-update
if: matrix.php == '8.1' && matrix.swagger-lume-flags == 'lumen-10-swagger-3-ui-4'
- name: Lumen 11 && Swagger 3
env:
SWAGGER_VERSION: '3.0'
run: |
composer require 'laravel/lumen-framework:11.*' --no-interaction --no-update
composer require 'zircote/swagger-php:4.*' --no-interaction --no-update
if: matrix.php == '8.2' && matrix.swagger-lume-flags == 'lumen-11-swagger-4'
- name: Lumen 11 && Swagger 3 && Swagger-UI 4
env:
SWAGGER_VERSION: '3.0'
run: |
composer require 'laravel/lumen-framework:11.*' --no-interaction --no-update
composer require 'zircote/swagger-php:4.*' --no-interaction --no-update
composer require 'swagger-api/swagger-ui:4.*' --no-interaction --no-update
composer require 'phpunit/phpunit:10.*' --no-interaction --no-update
if: matrix.php == '8.2' && matrix.swagger-lume-flags == 'lumen-11-swagger-4-ui-4'
- name: Prepare code climate
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
if: matrix.php == '8.2' && matrix.swagger-lume-flags == 'latest'
- name: Run test suite
run: composer run-script phpunit
- name: Publish code coverage
env:
CC_TEST_REPORTER_ID: c0cc7b0c0b5fcbca94823ff49d1798712d947ec3784f252ebabcdeb711a4f1c8
run: |
cp ${{github.workspace}}/tests/storage/logs/test-reports/clover.xml ${{github.workspace}}/clover.xml
./cc-test-reporter after-build -t clover --exit-code 0
if: matrix.php == '8.2' && matrix.swagger-lume-flags == 'latest'
- name: Publish coveralls report
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: vendor/bin/php-coveralls --coverage_clover=clover.xml -v
if: matrix.php == '8.2' && matrix.swagger-lume-flags == 'latest'