Skip to content

Commit 19c2029

Browse files
committed
Initial commit
0 parents  commit 19c2029

File tree

572 files changed

+74181
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

572 files changed

+74181
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,308 @@
1+
name: Collection test suite
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: 3 0 * * * # Run daily at 0:03 UTC
8+
9+
jobs:
10+
build-collection-artifact:
11+
name: Build collection
12+
runs-on: ${{ matrix.runner-os }}
13+
strategy:
14+
matrix:
15+
runner-os:
16+
- ubuntu-latest
17+
ansible-version:
18+
- git+https://github.com/ansible/ansible.git@devel
19+
runner-python-version:
20+
- 3.8
21+
steps:
22+
- name: Check out ${{ github.repository }} on disk
23+
uses: actions/checkout@master
24+
- name: Set up Python ${{ matrix.runner-python-version }}
25+
uses: actions/setup-python@v1
26+
with:
27+
python-version: ${{ matrix.runner-python-version }}
28+
- name: Set up pip cache
29+
uses: actions/cache@v1
30+
with:
31+
path: ~/.cache/pip
32+
key: ${{ runner.os }}-pip-${{ hashFiles('tests/sanity/requirements.txt') }}-${{ hashFiles('tests/unit/requirements.txt') }}
33+
restore-keys: |
34+
${{ runner.os }}-pip-
35+
${{ runner.os }}-
36+
- name: Install Ansible ${{ matrix.ansible-version }}
37+
run: >-
38+
python -m
39+
pip
40+
install
41+
--user
42+
${{ matrix.ansible-version }}
43+
- name: Build a collection tarball
44+
run: >-
45+
~/.local/bin/ansible-galaxy
46+
collection
47+
build
48+
--output-path
49+
"${GITHUB_WORKSPACE}/.cache/collection-tarballs"
50+
- name: Store migrated collection artifacts
51+
uses: actions/upload-artifact@v1
52+
with:
53+
name: >-
54+
collection
55+
path: .cache/collection-tarballs
56+
57+
sanity-test-collection-via-vms:
58+
name: Sanity in VM ${{ matrix.os.vm || 'ubuntu-latest' }}
59+
needs:
60+
- build-collection-artifact
61+
runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }}
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
ansible-version:
66+
- git+https://github.com/ansible/ansible.git@devel
67+
os:
68+
- vm: ubuntu-latest
69+
- vm: ubuntu-16.04
70+
- vm: macos-latest
71+
python-version:
72+
- 3.8
73+
- 3.7
74+
- 3.6
75+
- 3.5
76+
- 2.7
77+
steps:
78+
- name: Set up Python ${{ matrix.python-version }}
79+
uses: actions/setup-python@v1
80+
with:
81+
python-version: ${{ matrix.python-version }}
82+
- name: Set up pip cache
83+
uses: actions/cache@v1
84+
with:
85+
path: ~/.cache/pip
86+
key: ${{ runner.os }}-pip-${{ github.ref }}-sanity-VMs
87+
restore-keys: |
88+
${{ runner.os }}-pip-
89+
${{ runner.os }}-
90+
- name: Install Ansible ${{ matrix.ansible-version }}
91+
run: >-
92+
python -m
93+
pip
94+
install
95+
--user
96+
${{ matrix.ansible-version }}
97+
- name: Download migrated collection artifacts
98+
uses: actions/download-artifact@v1
99+
with:
100+
name: >-
101+
collection
102+
path: .cache/collection-tarballs
103+
- name: Install the collection tarball
104+
run: >-
105+
~/.local/bin/ansible-galaxy
106+
collection
107+
install
108+
.cache/collection-tarballs/*.tar.gz
109+
- name: Run collection sanity tests
110+
run: >-
111+
~/.local/bin/ansible-test
112+
sanity
113+
--color
114+
--requirements
115+
--venv
116+
--python
117+
"${{ matrix.python-version }}"
118+
-vvv
119+
working-directory: >-
120+
/${{ runner.os == 'Linux' && 'home' || 'Users' }}/runner/.ansible/collections/ansible_collections/community/vmware
121+
122+
sanity-test-collection-via-containers:
123+
name: Sanity in container via Python ${{ matrix.python-version }}
124+
needs:
125+
- build-collection-artifact
126+
runs-on: ${{ matrix.runner-os }}
127+
strategy:
128+
fail-fast: false
129+
matrix:
130+
runner-os:
131+
- ubuntu-latest
132+
runner-python-version:
133+
- 3.8
134+
ansible-version:
135+
- git+https://github.com/ansible/ansible.git@devel
136+
python-version:
137+
- 3.8
138+
- 2.7
139+
- 3.7
140+
- 3.6
141+
- 3.5
142+
- 2.6
143+
steps:
144+
- name: Set up Python ${{ matrix.runner-python-version }}
145+
uses: actions/setup-python@v1
146+
with:
147+
python-version: ${{ matrix.runner-python-version }}
148+
- name: Set up pip cache
149+
uses: actions/cache@v1
150+
with:
151+
path: ~/.cache/pip
152+
key: ${{ runner.os }}-pip-${{ github.ref }}-sanity-containers
153+
restore-keys: |
154+
${{ runner.os }}-pip-
155+
${{ runner.os }}-
156+
- name: Install Ansible ${{ matrix.ansible-version }}
157+
run: >-
158+
python -m
159+
pip
160+
install
161+
--user
162+
${{ matrix.ansible-version }}
163+
- name: Download migrated collection artifacts
164+
uses: actions/download-artifact@v1
165+
with:
166+
name: >-
167+
collection
168+
path: .cache/collection-tarballs
169+
- name: Install the collection tarball
170+
run: >-
171+
~/.local/bin/ansible-galaxy
172+
collection
173+
install
174+
.cache/collection-tarballs/*.tar.gz
175+
- name: Run collection sanity tests
176+
run: >-
177+
~/.local/bin/ansible-test
178+
sanity
179+
--color
180+
--requirements
181+
--docker
182+
--python
183+
"${{ matrix.python-version }}"
184+
-vvv
185+
working-directory: >-
186+
/home/runner/.ansible/collections/ansible_collections/community/vmware
187+
188+
unit-test-collection-via-vms:
189+
name: Units in VM ${{ matrix.os.vm || 'ubuntu-latest' }}
190+
needs:
191+
- build-collection-artifact
192+
runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }}
193+
strategy:
194+
fail-fast: false
195+
matrix:
196+
ansible-version:
197+
- git+https://github.com/ansible/ansible.git@devel
198+
os:
199+
- vm: ubuntu-latest
200+
- vm: ubuntu-16.04
201+
- vm: macos-latest
202+
python-version:
203+
- 3.8
204+
- 3.7
205+
- 3.6
206+
- 3.5
207+
- 2.7
208+
steps:
209+
- name: Set up Python ${{ matrix.python-version }}
210+
uses: actions/setup-python@v1
211+
with:
212+
python-version: ${{ matrix.python-version }}
213+
- name: Set up pip cache
214+
uses: actions/cache@v1
215+
with:
216+
path: ~/.cache/pip
217+
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
218+
restore-keys: |
219+
${{ runner.os }}-pip-
220+
${{ runner.os }}-
221+
- name: Install Ansible ${{ matrix.ansible-version }}
222+
run: >-
223+
python -m
224+
pip
225+
install
226+
--user
227+
${{ matrix.ansible-version }}
228+
- name: Download migrated collection artifacts
229+
uses: actions/download-artifact@v1
230+
with:
231+
name: >-
232+
collection
233+
path: .cache/collection-tarballs
234+
- name: Install the collection tarball
235+
run: >-
236+
~/.local/bin/ansible-galaxy
237+
collection
238+
install
239+
.cache/collection-tarballs/*.tar.gz
240+
- name: Run collection unit tests
241+
run: |
242+
[[ ! -d 'tests/unit' ]] && echo This collection does not have unit tests. Skipping... || \
243+
~/.local/bin/ansible-test units --color --coverage --requirements --venv --python "${{ matrix.python-version }}" -vvv
244+
working-directory: >-
245+
/${{ runner.os == 'Linux' && 'home' || 'Users' }}/runner/.ansible/collections/ansible_collections/community/vmware
246+
247+
unit-test-collection-via-containers:
248+
name: Units in container ${{ matrix.container-image }}
249+
needs:
250+
- build-collection-artifact
251+
runs-on: ${{ matrix.runner-os }}
252+
strategy:
253+
fail-fast: false
254+
matrix:
255+
runner-os:
256+
- ubuntu-latest
257+
runner-python-version:
258+
- 3.8
259+
ansible-version:
260+
- git+https://github.com/ansible/ansible.git@devel
261+
container-image:
262+
- fedora31
263+
- ubuntu1804
264+
- centos8
265+
- opensuse15
266+
- fedora30
267+
- centos7
268+
- opensuse15py2
269+
- ubuntu1604
270+
- centos6
271+
steps:
272+
- name: Set up Python ${{ matrix.runner-python-version }}
273+
uses: actions/setup-python@v1
274+
with:
275+
python-version: ${{ matrix.runner-python-version }}
276+
- name: Set up pip cache
277+
uses: actions/cache@v1
278+
with:
279+
path: ~/.cache/pip
280+
key: ${{ runner.os }}-pip-${{ github.ref }}-units-containers
281+
restore-keys: |
282+
${{ runner.os }}-pip-
283+
${{ runner.os }}-
284+
- name: Install Ansible ${{ matrix.ansible-version }}
285+
run: >-
286+
python -m
287+
pip
288+
install
289+
--user
290+
${{ matrix.ansible-version }}
291+
- name: Download migrated collection artifacts
292+
uses: actions/download-artifact@v1
293+
with:
294+
name: >-
295+
collection
296+
path: .cache/collection-tarballs
297+
- name: Install the collection tarball
298+
run: >-
299+
~/.local/bin/ansible-galaxy
300+
collection
301+
install
302+
.cache/collection-tarballs/*.tar.gz
303+
- name: Run collection unit tests
304+
run: |
305+
[[ ! -d 'tests/unit' ]] && echo This collection does not have unit tests. Skipping... || \
306+
~/.local/bin/ansible-test units --color --coverage --requirements --docker "${{ matrix.container-image }}" -vvv
307+
working-directory: >-
308+
/home/runner/.ansible/collections/ansible_collections/community/vmware

0 commit comments

Comments
 (0)