Skip to content

Devel CI

Devel CI #475

Workflow file for this run

---
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-latest
strategy:
fail-fast: false
matrix:
include:
- test_type: source-static
ansible: "ansible-core"
python: "3.10"
steps:
- uses: actions/checkout@v2.3.1
- 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