This repository was archived by the owner on Oct 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
281 lines (226 loc) · 8.38 KB
/
Copy pathIntegrate.yml
File metadata and controls
281 lines (226 loc) · 8.38 KB
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
---
name: Integrate
# yamllint disable-line rule:truthy
on:
pull_request:
push:
branches:
- 3.x.x
tags:
# Run every night at 05:15.
schedule:
- cron: '15 5 * * *'
jobs:
php:
name: PHP ${{ matrix.php-version }} / Composer ${{ matrix.composer-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- '7.4'
- '8.0'
- '8.1'
composer-version:
- 2
include:
- php-version: '7.4'
composer-extra-arguments: '--prefer-lowest'
phpstan-extra-arguments: '-c ./phpstan-lowest.neon.dist'
steps:
- name: Checkout
uses: actions/checkout@v2
# Some tests run Composer via command line. It's not possible to require
# a package in the detached state. Checkout to a branch to workaround
# this.
- name: Checkout to a branch
run: git checkout -b test
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
tools: composer:v${{ matrix.composer-version }}
- 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@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-${{ hashFiles('composer.json') }}
restore-keys: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-
- name: Install Composer dependencies
run: composer update --no-progress --prefer-dist --optimize-autoloader ${{ matrix.composer-extra-arguments }}
- name: Coding standards
run: vendor/bin/phpcs
- name: Static Code Analysis
run: vendor/bin/phpstan analyse ${{ matrix.phpstan-extra-arguments }}
- name: Tests
run: vendor/bin/phpunit
molecule:
name: Molecule / ubuntu/${{ matrix.molecule-platform }}
needs: php
runs-on: ubuntu-latest
strategy:
matrix:
composer-version:
- 2
php-version:
- '7.4'
python-version:
- '3.9'
molecule-platform:
- 20.04
- 22.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
tools: composer:v${{ matrix.composer-version }}
- 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@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-${{ hashFiles('composer.json') }}
restore-keys: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-
- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Get PiP Cache Directory
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache PiP dependencies
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('./molecule/requirements.txt') }}
- name: Cache Python environment
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('./molecule/requirements.txt') }}
- name: Install Molecule and it's dependencies
run: pip install --upgrade --upgrade-strategy eager --requirement ./molecule/requirements.txt
- name: Run Molecule tests
run: molecule test
env:
MOLECULE_PLATFORM: ${{ matrix.molecule-platform }}
# Force color output.
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
vagrant:
name: Vagrant / ubuntu/${{ matrix.vagrant-box }}
needs: php
runs-on: macos-12
strategy:
matrix:
composer-version:
- 2
php-version:
- '7.4'
vagrant-box:
- focal64
- jammy64
# Workaround 'XXX may have been in progress in another thread when fork()
# was called.'
# See https://github.com/ansible/ansible/issues/32499
env:
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: 'YES'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
tools: composer:v${{ matrix.composer-version }}
- 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@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-${{ hashFiles('composer.json') }}
restore-keys: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-
- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev
- name: Set Vagrant box to use
run: sed -i '' 's/focal64/${{ matrix.vagrant-box }}/g' default.vm-settings.yml
- name: Install Vagrant
run: brew install vagrant
# See https://github.com/hashicorp/vagrant/pull/12581
- name: Fix missing VagrantPlugins::HostDarwin::Cap::Version on Big Sur
run: |
file_to_patch="/opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb"
download_url="https://raw.githubusercontent.com/hashicorp/vagrant/42db2569e32a69e604634462b633bb14ca20709a/plugins/hosts/darwin/cap/path.rb"
if [ "$(vagrant --version)" = 'Vagrant 2.2.19' ]; then
sudo rm $file_to_patch
sudo wget $download_url -q -O $file_to_patch
fi
- name: Allow 10.0.0.0/8 192.168.0.0/16 ranges to be assigned to host-only adapters
run: |
sudo mkdir /etc/vbox
echo "* 10.0.0.0/8 192.168.0.0/16" | sudo tee -a /etc/vbox/networks.conf
- name: Start the machine (without provisioning)
run: vagrant up --no-provision
code-coverage:
name: Code Coverage
needs: php
runs-on: ubuntu-latest
strategy:
matrix:
composer-version:
- 2
php-version:
- 7.4
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 50
# Some tests run Composer via command line. It's not possible to require
# a package in the detached state. Checkout to a branch to workaround
# this.
- name: Checkout to a branch
run: git checkout -b test
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: xdebug
php-version: ${{ matrix.php-version }}
tools: composer:v${{ matrix.composer-version }}
- 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@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-${{ hashFiles('composer.json') }}
restore-keys: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-
- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader
- name: Collect code coverage
run: vendor/bin/phpunit --testsuite=unit --coverage-clover=coverage.xml
- name: Send code coverage report to Codecov.io
uses: codecov/codecov-action@v1
with:
file: coverage.xml