-
Notifications
You must be signed in to change notification settings - Fork 8
162 lines (154 loc) · 4.48 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 6 * * *'
env:
COLORTERM: 'yes'
TERM: 'xterm-256color'
PYTEST_ADDOPTS: '--color=yes'
jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python:
- "3.10"
ansible:
- stable-2.12
- stable-2.13
- stable-2.14
- stable-2.15
- devel
include:
- python: "3.8"
ansible: "stable-2.12"
- python: "3.9"
ansible: "stable-2.13"
- python: "3.11"
ansible: "devel"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install libyaml-dev for PyYAML
run: sudo apt-get install -y libyaml-dev
- name: Install Ansible
run: pip install --upgrade https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz
- name: Install dependencies
run: make test-setup
- name: Run sanity tests
run: make SANITY_OPTS="--local" sanity
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
run: make doc-setup
- name: Build docs
run: make doc
- name: Upload docs artifact
uses: actions/upload-artifact@v3
with:
name: docs-html
path: docs/_build/html/
galaxy-importer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
run: pip install --upgrade py galaxy-importer
- name: Run galaxy-importer
run: make galaxy-importer
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
run: |
pip install --upgrade ansible-core
pip install --upgrade -r requirements-lint.txt
- name: Install required collections for linting
run: ansible-galaxy collection install theforeman.operations
- name: Run lint
run: make lint
- name: Upload collection artifact
uses: actions/upload-artifact@v3
with:
name: collection
path: redhat-satellite_operations-*.tar.gz
molecule:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python:
- "3.10"
ansible:
- stable-2.12
- stable-2.13
- stable-2.14
- stable-2.15
- devel
include:
- python: "3.8"
ansible: "stable-2.9"
- python: "3.8"
ansible: "stable-2.10"
- python: "3.9"
ansible: "stable-2.11"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Ansible
run: pip install --upgrade https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz
- name: Install dependencies
run: make test-setup
- name: Install Ansible 2.9 compatible molecule
run: pip install --upgrade 'molecule[docker,lint]<4.0'
if: matrix.ansible == 'stable-2.9'
- name: Run tests
env:
DRIVER_NAME: docker
run: ./tests/molecule.sh
execution_environment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
run: pip install --upgrade ansible-core ansible-builder ansible-navigator
- name: Build EE
run: ansible-builder build -v 3 -t test-ee:latest -f meta/execution-environment.yml