-
-
Notifications
You must be signed in to change notification settings - Fork 37
185 lines (165 loc) · 6.5 KB
/
integrationtest.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
---
name: Integration Test
on:
# Run on pushes to `master` and on all pull requests.
push:
branches:
- master
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
phpcs_version: ['dev-master']
phpcompat: ['composer']
experimental: [false]
include:
# Ensure a "highest" PHP/PHPCS build combination for PHPCS 2.x is included.
- php: '5.3'
phpcs_version: '2.9.2'
phpcompat: 'composer'
experimental: false
# Complement the matrix with build against the lowest supported PHPCS version
# for each PHP version.
- php: '8.1'
# Lowest PHPCS version on which PHP 8.1 is supported.
phpcs_version: '3.6.1'
phpcompat: 'composer'
experimental: false
- php: '8.0'
# Lowest PHPCS version on which PHP 8.0 is supported.
phpcs_version: '3.5.7'
phpcompat: 'composer'
experimental: false
- php: '7.4'
# Lowest PHPCS version on which PHP 7.4 is supported.
phpcs_version: '3.5.0'
phpcompat: 'composer'
experimental: false
- php: '7.3'
# Lowest PHPCS version on which PHP 7.3 is supported.
phpcs_version: '3.3.1'
phpcompat: 'composer'
experimental: false
- php: '7.2'
# Lowest PHPCS version on which PHP 7.2 is supported.
phpcs_version: '2.9.2'
phpcompat: 'composer'
experimental: false
- php: '7.1'
phpcs_version: '2.0.0'
phpcompat: '^7.0'
experimental: false
- php: '7.0'
phpcs_version: '2.0.0'
phpcompat: '^7.0'
experimental: false
- php: '5.6'
phpcs_version: '2.0.0'
phpcompat: '^7.0'
experimental: false
- php: '5.5'
phpcs_version: '2.0.0'
phpcompat: '^7.0'
experimental: false
- php: '5.4'
phpcs_version: '2.0.0'
phpcompat: '^7.0'
experimental: false
- php: '5.3'
phpcs_version: '2.0.0'
phpcompat: '^7.0'
experimental: false
# Additional builds against arbitrary interim PHPCS versions.
- php: '7.3'
phpcs_version: '3.5.3'
phpcompat: 'composer'
experimental: false
- php: '7.2'
phpcs_version: '3.2.3'
phpcompat: 'composer'
experimental: false
- php: '7.1'
phpcs_version: '3.1.1'
phpcompat: 'composer'
experimental: false
- php: '7.0'
phpcs_version: '3.4.2'
phpcompat: 'composer'
experimental: false
- php: '7.0'
phpcs_version: '2.2.0'
phpcompat: '^8.0'
experimental: false
- php: '5.6'
phpcs_version: '3.0.2'
phpcompat: 'composer'
experimental: false
- php: '5.6'
phpcs_version: '2.4.0'
phpcompat: 'composer'
experimental: false
- php: '5.5'
phpcs_version: '2.6.1'
phpcompat: 'composer'
experimental: false
- php: '5.4'
phpcs_version: '3.5.3'
phpcompat: 'composer'
experimental: false
- php: '5.4'
phpcs_version: '2.8.1'
phpcompat: 'composer'
experimental: false
# Experimental builds. These are allowed to fail.
- php: '8.2'
phpcs_version: 'dev-master'
phpcompat: 'composer'
experimental: true
- php: '8.1'
phpcs_version: '4.0.x-dev as 3.9.99'
phpcompat: 'composer'
experimental: true
name: "Integration test: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: error_reporting=E_ALL, display_errors=On
coverage: none
- name: 'Composer: set PHPCS version for tests'
run: composer require --no-update --no-scripts squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}"
# Install PHPCompatibility 7.x/8.x for PHPCS < 2.3.
- name: 'Composer: set PHPCompatibility version for tests (PHPCS < 2.3)'
if: ${{ matrix.phpcompat != 'composer' }}
run: composer require --dev --no-update --no-scripts phpcompatibility/php-compatibility:"${{ matrix.phpcompat }}"
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: 'Install Composer dependencies'
uses: "ramsey/composer-install@v1"
with:
composer-options: --no-scripts --optimize-autoloader
# Rename the PHPCompatibility directory as PHPCompatibility 7.x wasn't fully compatible with Composer yet.
- name: 'Rename the PHPCompatibility directory (PHPCS < 2.2)'
if: ${{ matrix.phpcompat == '^7.0' }}
run: mv ./vendor/phpcompatibility/php-compatibility ./vendor/phpcompatibility/PHPCompatibility
- name: 'Install standards'
run: composer install-codestandards
- name: 'Show installed standards'
run: vendor/bin/phpcs -i
# Test that an external standard has been registered correctly by running it against the codebase on PHPCS < 2.3.
- name: 'Test the PHPCompatibility standard was installed succesfully (PHPCS < 2.3)'
if: ${{ matrix.phpcompat != 'composer' }}
run: ./vendor/bin/phpcs -ps ./src/ --standard=PHPCompatibility --sniffs=PHPCompatibility.PHP.DeprecatedFunctions --runtime-set testVersion ${{ matrix.php }}
# Test that an external standard has been registered correctly by running it against the codebase.
- name: 'Test the PHPCompatibility standard was installed succesfully (PHPCS >= 2.3)'
if: ${{ matrix.phpcompat == 'composer' }}
run: ./vendor/bin/phpcs -ps ./src/ --standard=PHPCompatibility --sniffs=PHPCompatibility.FunctionUse.RemovedFunctions --runtime-set testVersion ${{ matrix.php }}