This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
127 lines (127 loc) · 4.62 KB
/
devel_ci.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
---
name: Devel CI
on:
workflow_dispatch:
pull_request:
paths:
- 'roles/pulp_devel/**'
- '.github/workflows/devel_ci.yml'
- 'molecule/source-static/**'
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '15 2 * * *'
jobs:
molecule:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- test_type: source-static
ansible: "ansible-core"
python: "3.10"
steps:
- uses: actions/[email protected]
- name: Configure the kernel to allow containers to talk to eachother
run: |
sudo sysctl net.bridge.bridge-nf-call-iptables=0
sudo sysctl net.bridge.bridge-nf-call-arptables=0
sudo sysctl net.bridge.bridge-nf-call-ip6tables=0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip
run: |
pip install --upgrade pip
- name: Install Python 2 packages
if: matrix.python == '2.7'
run: |
pip install "sh<1.13" "ruamel.yaml<0.17" "ruamel.yaml.clib<0.2.3"
- name: Install Python 3 packages
if: matrix.python != '2.7'
run: |
pip install molecule-docker
- name: Install Ansible & Molecule
run: |
sudo apt remove ansible
pip install docker molecule ${{ matrix.ansible }}
- name: Workaround bug with latest molecule and ansible 2.9
if: matrix.python != '2.7' && matrix.ansible == 'ansible~=2.9.0'
run: pip install molecule~=3.6.1 molecule-docker~=1.1
shell: bash
# Stable release 0.3.3 does not support Ansible 6 / ansible-core 2.13.
# Stable releases 0.2.z support Ansible 2.9, but not with collections support.
- name: Install mitogen (Ansible 2.10+)
if: matrix.ansible != 'ansible~=2.9.0'
run: |
cd ..
git clone https://github.com/mitogen-hq/mitogen.git
pip install ./mitogen
shell: bash
- name: Setting pulp.pulp_installer collection
# Downloading dependencies sometimes fails the 1st time, so retry
run: |
make vendor || make vendor
make install || make install
rm playbooks/resize_disk.yaml
ansible-galaxy collection install -p build/collections --force community.docker ||
ansible-galaxy collection install -p build/collections --force community.docker
shell: bash
- name: Molecule dependency
# Downloading dependencies sometimes fails the 1st time
run: |
ansible --version
molecule dependency --scenario-name ${{ matrix.test_type }} ||
molecule dependency --scenario-name ${{ matrix.test_type }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
shell: bash
- name: Molecule create & prepare
# Pulling images (for upgrades) sometimes fails the 1st time.
run: |
ansible --version
molecule create --scenario-name ${{ matrix.test_type }} ||
molecule create --scenario-name ${{ matrix.test_type }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
shell: bash
- name: Molecule converge
run: |
ansible --version
set +e
MITOGEN_LOCATION=$(pip show mitogen | grep Location | cut -f 2 -d " ")
set -e
if [ "$MITOGEN_LOCATION" != ""]; then
STRATEGY=mitogen_linear
MITOGEN_PATH=$MITOGEN_LOCATION/ansible_mitogen/plugins/strategy/
else
STRATEGY=linear # The default
fi
ANSIBLE_STRATEGY=${STRATEGY} ANSIBLE_STRATEGY_PLUGINS=${MITOGEN_PATH} molecule converge --scenario-name ${{ matrix.test_type }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
shell: bash
- name: Molecule idempotence
# release-upgrade is multi-phase upgrading, a non-idempotent playbook
# release-cluster takes the 2nd longest but is theoretically covered by
# release-static and packages-cluster
if: matrix.test_type != 'release-upgrade' && matrix.test_type != 'release-cluster'
run: |
ansible --version
molecule idempotence --scenario-name ${{ matrix.test_type }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
shell: bash
- name: Molecule verify
run: |
ansible --version
molecule verify --scenario-name ${{ matrix.test_type }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
shell: bash