Skip to content

Pulp Nightly CI

Pulp Nightly CI #19

Workflow file for this run

---
name: Pulp Nightly CI
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '15 0 * * *'
workflow_dispatch:
jobs:
molecule:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
# Testing different python versions because of
# https://pulp.plan.io/issues/5768#note-17
#
# Certain old versions are in distros:
# Fedora / EPEL8 / Ubuntu 20.04: ansible 2.9
# Debian 11 / Ubuntu 21.10: ansible 2.10
matrix:
include:
- test_type: release-static
ansible: "ansible~=2.9.0"
python: "2.7"
- test_type: source-static
ansible: "ansible-core" # currently at 2.13.0
python: "3.10"
- test_type: packages-static
ansible: "ansible~=2.10.0"
python: "3.7"
- test_type: release-cluster
ansible: "ansible-core~=2.12.0"
python: "3.8"
- test_type: source-cluster
ansible: "ansible~=2.9.0"
python: "3.8"
- test_type: packages-cluster
ansible: "ansible" # currently at 5.3.0
python: "3.9"
- test_type: release-upgrade
ansible: "ansible-core~=2.11.0" # used by ansible==4.10.0
python: "3.6"
- test_type: source-upgrade
ansible: "ansible~=3.0"
python: "3.9"
- test_type: packages-upgrade
ansible: "ansible~=2.9.0"
python: "2.7"
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
# https://github.com/ansible-community/molecule-docker/issues/161#issuecomment-1192604356
- name: Molecule dependency
# Downloading dependencies sometimes fails the 1st time
run: |
ansible --version
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
if: matrix.test_type != 'release-upgrade'
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
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# by default, it uses a depth of 1
# this fetches all history so that we can read each commit
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install python dependencies
run: |
echo ::group::PYDEPS
pip install gitpython requests packaging
echo ::endgroup::
- name: Configure Git with pulpbot name and email
run: |
git config --global user.name 'pulpbot'
git config --global user.email 'pulp-infra@redhat.com'
- name: Changelog history
run: python .ci/scripts/changelog.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.RELEASE_TOKEN }}
committer: pulpbot <pulp-infra@redhat.com>
author: pulpbot <pulp-infra@redhat.com>
title: 'Update Changelog'
body: '[noissue]'
branch: 'changelog/update'
base: main
commit-message: |
Update Changelog
[noissue]
delete-branch: true
publish-docs:
name: Publish docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run publish docs script
env:
PULP_DOCS_KEY: ${{ secrets.PULP_DOCS_KEY }}
run: .ci/scripts/publish_docs.sh ${GITHUB_REF##*/}
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2.3.1
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install Ansible
run: |
pip install --upgrade pip
sudo apt remove ansible
pip install ansible-core
- name: Install Ansible-lint
run: |
# pulp_installer is now on maintenance, so limit the lint checks
pip install "ansible-lint[yamllint]<6.13"
- name: Lint test
run: |
ansible-lint