1
1
name : CI
2
2
on :
3
3
push :
4
- branches : master
4
+ branches : [ master]
5
5
pull_request :
6
6
schedule :
7
- # * is a special character in YAML so you have to quote this string
8
- - cron : ' 0 8 * * *'
7
+ # * is a special character in YAML so you have to quote this string
8
+ - cron : ' 0 8 * * *'
9
9
env :
10
10
python_version : ' 3.10'
11
11
jobs :
@@ -17,25 +17,25 @@ jobs:
17
17
matrix :
18
18
ansible : [v2.14.13, v2.15.8, v2.16.2, stable-2.16]
19
19
steps :
20
- - name : Check out code
21
- uses : actions/checkout@v3
22
-
23
- - name : Set up Python ${{ env.python_version }}
24
- uses : actions/setup-python@v4
25
- with :
26
- python-version : ${{ env.python_version }}
27
-
28
- - name : Install ansible-base (${{ matrix.ansible }})
29
- run : pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
30
-
31
- - name : Build a collection tarball
32
- run : ansible-galaxy collection build --output-path "${GITHUB_WORKSPACE}/.cache/collection-tarballs"
33
-
34
- - name : Store migrated collection artifacts
35
- uses : actions/upload-artifact@v3
36
- with :
37
- name : collection
38
- path : .cache/collection-tarballs
20
+ - name : Check out code
21
+ uses : actions/checkout@v3
22
+
23
+ - name : Set up Python ${{ env.python_version }}
24
+ uses : actions/setup-python@v4
25
+ with :
26
+ python-version : ${{ env.python_version }}
27
+
28
+ - name : Install ansible-base (${{ matrix.ansible }})
29
+ run : pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
30
+
31
+ - name : Build a collection tarball
32
+ run : ansible-galaxy collection build --output-path "${GITHUB_WORKSPACE}/.cache/collection-tarballs"
33
+
34
+ - name : Store migrated collection artifacts
35
+ uses : actions/upload-artifact@v3
36
+ with :
37
+ name : collection
38
+ path : .cache/collection-tarballs
39
39
40
40
black-formating :
41
41
name : Using Black to check formating
@@ -57,120 +57,126 @@ jobs:
57
57
importer :
58
58
name : Galaxy-importer check
59
59
needs :
60
- - build
60
+ - build
61
61
runs-on : ubuntu-latest
62
62
steps :
63
- - name : Set up Python ${{ env.python_version }}
64
- uses : actions/setup-python@v4
65
- with :
66
- python-version : ${{ env.python_version }}
63
+ - name : Set up Python ${{ env.python_version }}
64
+ uses : actions/setup-python@v4
65
+ with :
66
+ python-version : ${{ env.python_version }}
67
67
68
- - name : Install ansible-base (v2.15.8)
69
- run : pip install https://github.com/ansible/ansible/archive/v2.15.8.tar.gz --disable-pip-version-check
68
+ - name : Install ansible-base (v2.15.8)
69
+ run : pip install https://github.com/ansible/ansible/archive/v2.15.8.tar.gz --disable-pip-version-check
70
70
71
- - name : Download migrated collection artifacts
72
- uses : actions/download-artifact@v3
73
- with :
74
- name : collection
75
- path : .cache/collection-tarballs
71
+ - name : Download migrated collection artifacts
72
+ uses : actions/download-artifact@v3
73
+ with :
74
+ name : collection
75
+ path : .cache/collection-tarballs
76
76
77
- - name : Install the collection tarball
78
- run : ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz
77
+ - name : Install the collection tarball
78
+ run : ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz
79
79
80
- - name : Install galaxy-importer (v0.4.20)
81
- run : pip install galaxy-importer==0.4.20
80
+ - name : Install galaxy-importer
81
+ run : pip install galaxy-importer
82
82
83
- - name : Create galaxy-importer directory
84
- run : sudo mkdir -p /etc/galaxy-importer
83
+ - name : Create galaxy-importer directory
84
+ run : sudo mkdir -p /etc/galaxy-importer
85
85
86
- - name : Create galaxy-importer.cfg
87
- run : sudo cp /home/runner/.ansible/collections/ansible_collections/cisco/aci/.github/workflows/galaxy-importer.cfg /etc/galaxy-importer/galaxy-importer.cfg
86
+ - name : Create galaxy-importer.cfg
87
+ run : |
88
+ sudo cp \
89
+ /home/runner/.ansible/collections/ansible_collections/cisco/aci/.github/workflows/galaxy-importer.cfg \
90
+ /etc/galaxy-importer/galaxy-importer.cfg
88
91
89
- - name : Run galaxy-importer check
90
- run : python -m galaxy_importer.main .cache/collection-tarballs/cisco-*.tar.gz | tee .cache/collection-tarballs/log.txt && sudo cp ./importer_result.json .cache/collection-tarballs/importer_result.json
92
+ - name : Run galaxy-importer check
93
+ run : |
94
+ python -m galaxy_importer.main .cache/collection-tarballs/cisco-*.tar.gz \
95
+ | tee .cache/collection-tarballs/log.txt \
96
+ && sudo cp ./importer_result.json .cache/collection-tarballs/importer_result.json
91
97
92
- - name : Check warnings and errors
93
- run : if grep -E 'WARNING|ERROR' .cache/collection-tarballs/log.txt; then exit 1; else exit 0; fi
98
+ - name : Check warnings and errors
99
+ run : if grep -E 'WARNING|ERROR' .cache/collection-tarballs/log.txt; then exit 1; else exit 0; fi
94
100
95
- - name : Store galaxy_importer check log file
96
- uses : actions/upload-artifact@v3
97
- with :
98
- name : galaxy-importer-log
99
- path : .cache/collection-tarballs/importer_result.json
101
+ - name : Store galaxy_importer check log file
102
+ uses : actions/upload-artifact@v3
103
+ with :
104
+ name : galaxy-importer-log
105
+ path : .cache/collection-tarballs/importer_result.json
100
106
101
107
102
108
sanity :
103
109
name : Sanity in ubuntu-latest
104
110
needs :
105
- - build
111
+ - build
106
112
runs-on : ubuntu-latest
107
113
strategy :
108
114
fail-fast : false
109
115
matrix :
110
116
ansible : [v2.14.13, v2.15.8, v2.16.2, stable-2.16]
111
117
steps :
112
- - name : Set up Python ${{ env.python_version }}
113
- uses : actions/setup-python@v4
114
- with :
115
- python-version : ${{ env.python_version }}
116
-
117
- - name : Install ansible-base (${{ matrix.ansible }})
118
- run : pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
119
-
120
- - name : Install coverage (v4.5.4)
121
- run : pip install coverage==4.5.4
122
-
123
- - name : Download migrated collection artifacts
124
- uses : actions/download-artifact@v3
125
- with :
126
- name : collection
127
- path : .cache/collection-tarballs
128
-
129
- - name : Install the collection tarball
130
- run : ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz
131
-
132
- - name : Run sanity tests
133
- run : ansible-test sanity --docker -v --color --truncate 0 --coverage
134
- working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/aci
135
-
136
- - name : Generate coverage report
137
- run : ansible-test coverage xml -v --requirements --group-by command --group-by version
138
- working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/aci
139
-
140
- - name : Push coverate report to codecov.io
141
- run : bash <(curl -s https://codecov.io/bash) -s 'tests/output/reports/' -F sanity
142
- working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/aci
118
+ - name : Set up Python ${{ env.python_version }}
119
+ uses : actions/setup-python@v4
120
+ with :
121
+ python-version : ${{ env.python_version }}
122
+
123
+ - name : Install ansible-base (${{ matrix.ansible }})
124
+ run : pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
125
+
126
+ - name : Install coverage (v4.5.4)
127
+ run : pip install coverage==4.5.4
128
+
129
+ - name : Download migrated collection artifacts
130
+ uses : actions/download-artifact@v3
131
+ with :
132
+ name : collection
133
+ path : .cache/collection-tarballs
134
+
135
+ - name : Install the collection tarball
136
+ run : ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz
137
+
138
+ - name : Run sanity tests
139
+ run : ansible-test sanity --docker -v --color --truncate 0 --coverage
140
+ working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/aci
141
+
142
+ - name : Generate coverage report
143
+ run : ansible-test coverage xml -v --requirements --group-by command --group-by version
144
+ working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/aci
145
+
146
+ - name : Push coverate report to codecov.io
147
+ run : bash <(curl -s https://codecov.io/bash) -s 'tests/output/reports/' -F sanity
148
+ working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/aci
143
149
144
150
units :
145
151
name : Units in ubuntu-latest
146
152
needs :
147
- - build
153
+ - build
148
154
runs-on : ubuntu-latest
149
155
strategy :
150
156
fail-fast : false
151
157
matrix :
152
158
ansible : [v2.14.13, v2.15.8, v2.16.2, stable-2.16]
153
159
python-version : ['3.10']
154
160
steps :
155
- - name : Set up Python ${{ matrix.python-version }}
156
- uses : actions/setup-python@v4
157
- with :
158
- python-version : ${{ matrix.python-version }}
161
+ - name : Set up Python ${{ matrix.python-version }}
162
+ uses : actions/setup-python@v4
163
+ with :
164
+ python-version : ${{ matrix.python-version }}
159
165
160
- - name : Install ansible-base (${{ matrix.ansible }})
161
- run : pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
166
+ - name : Install ansible-base (${{ matrix.ansible }})
167
+ run : pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
162
168
163
- - name : Install coverage (v4.5.4)
164
- run : pip install coverage==4.5.4
169
+ - name : Install coverage (v4.5.4)
170
+ run : pip install coverage==4.5.4
165
171
166
- - name : Download migrated collection artifacts
167
- uses : actions/download-artifact@v3
168
- with :
169
- name : collection
170
- path : .cache/collection-tarballs
172
+ - name : Download migrated collection artifacts
173
+ uses : actions/download-artifact@v3
174
+ with :
175
+ name : collection
176
+ path : .cache/collection-tarballs
171
177
172
- - name : Install the collection tarball
173
- run : ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz
178
+ - name : Install the collection tarball
179
+ run : ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz
174
180
175
181
# - name: Run unit tests
176
182
# run: ansible-test units --docker -v --color --truncate 0 --python ${{ matrix.python-version }} --coverage
@@ -187,54 +193,58 @@ jobs:
187
193
integration :
188
194
name : Integration in ubuntu-latest
189
195
needs :
190
- - build
196
+ - build
191
197
runs-on : ubuntu-latest
198
+ env :
199
+ MUTEX_URL : https://8v7s765ibh.execute-api.us-west-1.amazonaws.com
192
200
steps :
193
- - name : Set up Python ${{ env.python_version }}
194
- uses : actions/setup-python@v4
195
- with :
196
- python-version : ${{ env.python_version }}
197
-
198
- - name : Install ansible-base (v2.15.8)
199
- run : pip install https://github.com/ansible/ansible/archive/v2.15.8.tar.gz --disable-pip-version-check
200
-
201
- - name : Install coverage (v4.5.4)
202
- run : pip install coverage==4.5.4
203
-
204
- - name : Download migrated collection artifacts
205
- uses : actions/download-artifact@v3
206
- with :
207
- name : collection
208
- path : .cache/collection-tarballs
209
-
210
- - name : Install the collection tarball
211
- run : ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz
212
-
213
- - name : Requesting integration mutex
214
- uses : nev7n/wait_for_response@v1
215
- with :
216
- url : ${{ format('https://8v7s765ibh.execute-api.us-west-1.amazonaws.com/v1/ansible-aci?repo={0}&run_id={1}', github.repository, github.run_id) }}
217
- responseCode : 200
218
- timeout : 2000000
219
- interval : 5000
220
-
221
- - name : Run integration tests on Python ${{ env.python_version }}
222
- run : ansible-test network-integration --docker -v --color --retry-on-error --python ${{ env.python_version }} --truncate 0 --continue-on-error --coverage
223
- working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/aci
224
-
225
- - name : Releasing integration mutex
226
- uses : nev7n/wait_for_response@v1
227
- if : always()
228
- with :
229
- url : ${{ format('https://8v7s765ibh.execute-api.us-west-1.amazonaws.com/v1/ansible-aci/release?repo={0}&run_id={1}', github.repository, github.run_id) }}
230
- responseCode : 200
231
-
232
- - name : Generate coverage report
233
- if : always()
234
- run : ansible-test coverage xml -v --requirements --group-by command --group-by version
235
- working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/aci
236
-
237
- - name : Push coverate report to codecov.io
238
- if : always()
239
- run : bash <(curl -s https://codecov.io/bash) -s 'tests/output/reports/' -F integration
240
- working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/aci
201
+ - name : Set up Python ${{ env.python_version }}
202
+ uses : actions/setup-python@v4
203
+ with :
204
+ python-version : ${{ env.python_version }}
205
+
206
+ - name : Install ansible-base (v2.15.8)
207
+ run : pip install https://github.com/ansible/ansible/archive/v2.15.8.tar.gz --disable-pip-version-check
208
+
209
+ - name : Install coverage (v4.5.4)
210
+ run : pip install coverage==4.5.4
211
+
212
+ - name : Download migrated collection artifacts
213
+ uses : actions/download-artifact@v3
214
+ with :
215
+ name : collection
216
+ path : .cache/collection-tarballs
217
+
218
+ - name : Install the collection tarball
219
+ run : ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz
220
+
221
+ - name : Requesting integration mutex
222
+ uses : nev7n/wait_for_response@v1
223
+ with :
224
+ url : ${{ format('{0}/v1/ansible-aci?repo={1}&run_id={2}', env.MUTEX_URL, github.repository, github.run_id) }}
225
+ responseCode : 200
226
+ timeout : 2000000
227
+ interval : 5000
228
+
229
+ - name : Run integration tests on Python ${{ env.python_version }}
230
+ run : |
231
+ ansible-test network-integration --docker -v --color --retry-on-error --python ${{ env.python_version }} \
232
+ --truncate 0 --continue-on-error --coverage
233
+ working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/aci
234
+
235
+ - name : Releasing integration mutex
236
+ uses : nev7n/wait_for_response@v1
237
+ if : always()
238
+ with :
239
+ url : ${{ format('{0}/v1/ansible-aci/release?repo={1}&run_id={2}', env.MUTEX_URL, github.repository, github.run_id) }}
240
+ responseCode : 200
241
+
242
+ - name : Generate coverage report
243
+ if : always()
244
+ run : ansible-test coverage xml -v --requirements --group-by command --group-by version
245
+ working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/aci
246
+
247
+ - name : Push coverate report to codecov.io
248
+ if : always()
249
+ run : bash <(curl -s https://codecov.io/bash) -s 'tests/output/reports/' -F integration
250
+ working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/aci
0 commit comments