forked from cisco-en-programmability/dnacenter-ansible
-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (52 loc) · 1.83 KB
/
sanity_tests.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
---
name: CI
on:
push:
branches: [main]
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
env:
NAMESPACE: cisco
COLLECTION_NAME: dnac
jobs:
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix
# 2.14 supports Python 3.9-3.11
# 2.15 supports Python 3.9-3.11
# 2.16 supports Python 3.10-3.12
# https://docs.ansible.com/ansible/devel/roadmap/ROADMAP_2_17.html
# milestone is 2.17 until after 2.17 branches from devel
# devel is 2.17 until 2024-04-01
sanity:
name: Sanity (Ⓐ${{ matrix.ansible }})
strategy:
matrix:
ansible:
- stable-2.15
- stable-2.16
- stable-2.17
- devel
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: cisco-en-programmability/dnacenter-ansible
- name: Create directory
run: mkdir -p ./ansible_collections/${{env.NAMESPACE}}
- name: Move repository
run: mv ./cisco-en-programmability/dnacenter-ansible ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Run sanity tests
run: ansible-test sanity --docker -v --color
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
- name: Install yamllint
run: pip install --user yamllint
- name: Run yamllint
run: yamllint -c .yamllint.yml .
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}