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