-
Notifications
You must be signed in to change notification settings - Fork 8
119 lines (100 loc) · 3.38 KB
/
ansible-test.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Copyright (c) 2020, Solace Corporation, Ricardo Gomez-Ulmke, <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
name: ansible-test
on:
# for testing
workflow_dispatch:
# # testing branches
# push:
# branches:
# - mtn-120
# schedule:
# # - cron: '0 1 * * THU'
# - cron: '0 2 * * *'
pull_request:
branches:
- main
env:
# DEBUG_FLAG: ${{ true }}
TEST_ANSIBLE_SOLACE_COLLECTION_DIR: "src/ansible_collections/solace/pubsub_plus"
PIP_DEVEL_REQUIREMENTS_FILE: "devel/devel.requirements.txt"
jobs:
ansbile_test:
# runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
# 3.6 is always tested
python-version: [ '3.8.10' ]
ansible-version: [
# "ansible>=2.10.3,<2.11", # this is 2.10
# "ansible>=4.10.0,<5.0.0", # this is 2.11
"ansible>=5.1.0,<6.0.0" # this is 2.12
]
steps:
- name: Check Auth
if: github.event_name == 'workflow_dispatch' && github.actor != 'ricardojosegomezulmke'
run: |
echo "not authorized"
echo "{IS_AUTHORIZED}={false}" >> $GITHUB_OUTPUT
id: auth
- name: Cancel Workflow
if: ${{ always() && steps.auth.outputs.IS_AUTHORIZED == 'false' }}
uses: andymckay/[email protected]
- name: update packages
run: |
# some release files are missing ...
# sudo apt-get update
sudo apt-get install libyaml-dev
sudo apt-get install shellcheck
- name: check pre-installed versions
run: |
lsb_release -a
which python
python --version
which python3
python3 --version
- name: Checkout Current Branch
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
# vm comes with a pre-installed python3.6
# ansible-test will also use that
# ==> install all devel requirements on that python3.6 version first
# python 3.6 support only available up to 2.11 ansible_core
- name: set up python 3.6
uses: actions/setup-python@v4
with:
python-version: 3.6
- name: Install ansible and devel requirements for 3.6
env:
ANSIBLE_VERSION: "ansible>=2.10.3,<2.11"
run: |
python -m pip install --upgrade pip
pip install "$ANSIBLE_VERSION"
pip install -r "${TEST_ANSIBLE_SOLACE_COLLECTION_DIR}/requirements.txt"
pip install -r "${PIP_DEVEL_REQUIREMENTS_FILE}"
- name: setup python matrix version
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install ansible and devel requirements for matrix version
env:
ANSIBLE_VERSION: "${{ matrix.ansible-version }}"
run: |
python -m pip install --upgrade pip
pip install "$ANSIBLE_VERSION"
pip install -r "${TEST_ANSIBLE_SOLACE_COLLECTION_DIR}/requirements.txt"
pip install -r "${PIP_DEVEL_REQUIREMENTS_FILE}"
- name: Print versions
run: |
ansible --version
which ansible-test
pip3 show ansible-doc-extractor
- name: Run ansible-test
run: |
cd ${TEST_ANSIBLE_SOLACE_COLLECTION_DIR}
ansible-test sanity
###
# The End.