66on :
77 # Triggers the workflow on push or pull request events but only for the develop branch
88 push :
9- branches : [ develop, main ]
9+ branches : [develop, main]
1010 pull_request :
11- branches : [ develop, main ]
11+ branches : [develop, main]
1212
1313 # Allows you to run this workflow manually from the Actions tab
1414 workflow_dispatch :
@@ -23,32 +23,32 @@ jobs:
2323 matrix :
2424 ansible : [2.15.13, 2.16.14, 2.17.12, 2.18.6]
2525 steps :
26- - name : Check out code
27- uses : actions/checkout@v2
28-
29- - name : Set up Python "3.11"
30- uses : actions/setup-python@v1
31- with :
32- python-version : " 3.11"
26+ - name : Check out code
27+ uses : actions/checkout@v2
3328
34- - name : Install ansible-base (v${{ matrix.ansible }})
35- run : pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
29+ - name : Set up Python "3.11"
30+ uses : actions/setup-python@v1
31+ with :
32+ python-version : " 3.11"
3633
37- - name : Build a DCNM collection tarball
38- run : ansible-galaxy collection build --output-path "${GITHUB_WORKSPACE}/.cache/ v${{ matrix.ansible }}/collection-tarballs"
34+ - name : Install ansible-base (v${{ matrix.ansible }})
35+ run : pip install https://github.com/ansible/ansible/archive/ v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
3936
40- - name : Store migrated collection artifacts
41- uses : actions/upload-artifact@v4.4.0
42- with :
43- name : collection_v${{ matrix.ansible }}
44- path : .cache/v${{ matrix.ansible }}/collection-tarballs
45- overwrite : true
37+ - name : Build a DCNM collection tarball
38+ run : ansible-galaxy collection build --output-path "${GITHUB_WORKSPACE}/.cache/v${{ matrix.ansible }}/collection-tarballs"
39+
40+ - name : Store migrated collection artifacts
41+ uses : actions/upload-artifact@v4.4.0
42+ with :
43+ name : collection_v${{ matrix.ansible }}
44+ path : .cache/v${{ matrix.ansible }}/collection-tarballs
45+ overwrite : true
4646
4747
4848 sanity :
4949 name : Run ansible-sanity tests
5050 needs :
51- - build
51+ - build
5252 runs-on : ubuntu-latest
5353 strategy :
5454 matrix :
@@ -64,75 +64,75 @@ jobs:
6464 - ansible : 2.18.6
6565 python : " 3.10"
6666 steps :
67- - name : Set up Python (v${{ matrix.python }})
68- uses : actions/setup-python@v1
69- with :
70- python-version : ${{ matrix.python }}
67+ - name : Set up Python (v${{ matrix.python }})
68+ uses : actions/setup-python@v1
69+ with :
70+ python-version : ${{ matrix.python }}
7171
72- - name : Install ansible-base (v${{ matrix.ansible }})
73- run : pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
72+ - name : Install ansible-base (v${{ matrix.ansible }})
73+ run : pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
7474
75- - name : Download migrated collection artifacts
76- uses : actions/download-artifact@v4.1.7
77- with :
78- name : collection_v${{ matrix.ansible }}
79- path : .cache/v${{ matrix.ansible }}/collection-tarballs
75+ - name : Download migrated collection artifacts
76+ uses : actions/download-artifact@v4.1.7
77+ with :
78+ name : collection_v${{ matrix.ansible }}
79+ path : .cache/v${{ matrix.ansible }}/collection-tarballs
8080
81- - name : Install the collection tarball
82- run : ansible-galaxy collection install .cache/v${{ matrix.ansible }}/collection-tarballs/*.tar.gz
81+ - name : Install the collection tarball
82+ run : ansible-galaxy collection install .cache/v${{ matrix.ansible }}/collection-tarballs/*.tar.gz
8383
84- - name : Run sanity tests
85- run : ansible-test sanity --docker --python ${{matrix.python}} -v --color --truncate 0
86- working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/dcnm
84+ - name : Run sanity tests
85+ run : ansible-test sanity --docker --python ${{matrix.python}} -v --color --truncate 0
86+ working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/dcnm
8787
8888
8989 unit-tests :
9090 name : Run DCNM Unit Tests
9191 needs :
92- - build
92+ - build
9393 runs-on : ubuntu-latest
9494 strategy :
9595 matrix :
9696 ansible : [2.15.13, 2.16.14, 2.17.12, 2.18.6]
9797 steps :
98- - name : Set up Python "3.11"
99- uses : actions/setup-python@v1
100- with :
101- python-version : " 3.11"
102-
103- - name : Install ansible-base (v${{ matrix.ansible }})
104- run : pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
105-
106- - name : Install Pydantic (v2)
107- run : pip install pydantic==2.11.10
108-
109- - name : Install Requests
110- run : pip install requests==2.32.5
111-
112- - name : Install DeepDiff (v8.5.0)
113- run : pip install deepdiff==8.5.0
114-
115- - name : Install coverage (v7.3.4)
116- run : pip install coverage==7.3.4
117-
118- - name : Install pytest (v7.4.4)
119- run : pip install pytest==7.4.4
120-
121- - name : Download migrated collection artifacts
122- uses : actions/download-artifact@v4.1.7
123- with :
124- name : collection_v${{ matrix.ansible }}
125- path : .cache/v${{ matrix.ansible }}/collection-tarballs
126-
127- - name : Install the collection tarball
128- run : ansible-galaxy collection install .cache/v${{ matrix.ansible }}/collection-tarballs/*.tar.gz
129-
130- - name : Run DCNM Unit tests
131- run : coverage run --source=. -m pytest tests/unit/. -vvvv
132- working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/dcnm
133- env :
134- PYTHONPATH : /home/runner/.ansible/collections
135-
136- - name : Generate coverage report
137- run : coverage report
138- working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/dcnm
98+ - name : Set up Python "3.11"
99+ uses : actions/setup-python@v1
100+ with :
101+ python-version : " 3.11"
102+
103+ - name : Install ansible-base (v${{ matrix.ansible }})
104+ run : pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
105+
106+ - name : Install Pydantic (v2)
107+ run : pip install pydantic==2.11.10
108+
109+ - name : Install Requests
110+ run : pip install requests==2.32.5
111+
112+ - name : Install DeepDiff (v8.5.0)
113+ run : pip install deepdiff==8.5.0
114+
115+ - name : Install coverage (v7.3.4)
116+ run : pip install coverage==7.3.4
117+
118+ - name : Install pytest (v7.4.4)
119+ run : pip install pytest==7.4.4
120+
121+ - name : Download migrated collection artifacts
122+ uses : actions/download-artifact@v4.1.7
123+ with :
124+ name : collection_v${{ matrix.ansible }}
125+ path : .cache/v${{ matrix.ansible }}/collection-tarballs
126+
127+ - name : Install the collection tarball
128+ run : ansible-galaxy collection install .cache/v${{ matrix.ansible }}/collection-tarballs/*.tar.gz
129+
130+ - name : Run DCNM Unit tests
131+ run : coverage run --source=. -m pytest tests/unit/. -vvvv
132+ working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/dcnm
133+ env :
134+ PYTHONPATH : /home/runner/.ansible/collections
135+
136+ - name : Generate coverage report
137+ run : coverage report
138+ working-directory : /home/runner/.ansible/collections/ansible_collections/cisco/dcnm
0 commit comments