-
Notifications
You must be signed in to change notification settings - Fork 9
79 lines (64 loc) · 2.4 KB
/
main.yml
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
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the develop branch
push:
branches: [ develop, main ]
pull_request:
branches: [ develop, main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Build DC VXLAN collection
runs-on: ubuntu-latest
strategy:
matrix:
ansible: [2.14.15, 2.15.10, 2.16.5]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python 3.10.14
uses: actions/setup-python@v5
with:
python-version: 3.10.14
- name: Install ansible-base (v${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Build a DCNM collection tarball
run: ansible-galaxy collection build --output-path "${GITHUB_WORKSPACE}/.cache/collection-tarballs"
- name: Store migrated collection artifacts
uses: actions/upload-artifact@v4
with:
name: collection-${{ matrix.ansible }}
path: .cache/collection-tarballs
sanity:
name: Sanity (Ⓐ${{ matrix.ansible }})
needs:
- build
runs-on: ubuntu-latest
strategy:
matrix:
ansible: [2.14.15, 2.15.10, 2.16.5]
python: ['3.10']
steps:
- name: Set up Python 3.10.14
uses: actions/setup-python@v5
with:
python-version: 3.10.14
- name: Upgrade pip
run: |
pip install --upgrade pip
- name: Install ansible-base (v${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/v${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Download migrated collection artifacts
uses: actions/download-artifact@v4
with:
name: collection-${{ matrix.ansible }}
path: .cache/collection-tarballs
- name: Install the collection tarball
run: ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz
- name: Run sanity tests
run: ansible-test sanity --docker --python ${{matrix.python}} -v --color --truncate 0
working-directory: /home/runner/.ansible/collections/ansible_collections/cisco/nac_dc_vxlan