Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Support new entrypoints #1830

Support new entrypoints

Support new entrypoints #1830

Workflow file for this run

---
name: Pulp CI
on: pull_request
jobs:
git-check:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- run: |
git fetch --prune --unshallow
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PyGithub
run: pip install pygithub
- name: Check commit message
env:
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
run: |
for sha in $(curl $GITHUB_CONTEXT | jq '.[].sha' | sed 's/"//g')
do
python .github/validate_commit_message.py $sha
VALUE=$?
if [ "$VALUE" -gt 0 ]; then
exit $VALUE
fi
done
shell: bash
- name: Check submodule status
run: |
.ci/submodule_check.sh
molecule:
runs-on: ubuntu-20.04
needs: git-check
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"
# We skip source-cluster for PR CI because no one probably does it.
- 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"
# We skip source-upgrade for PR CI because devs can always rebuild
# their vagrant environments.
- test_type: packages-upgrade
ansible: "ansible~=2.9.0"
python: "2.7"
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
# devel_ci.yml is where we run the devel role. For performance.
- name: Configure source-static to not run the devel role
if: matrix.test_type == 'source-static'
run: |
sed -i '/pulp_devel/d' molecule/source-static/converge.yml
- 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
lint:
runs-on: ubuntu-latest
needs: git-check
strategy:
fail-fast: false
steps:
- uses: actions/[email protected]
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
- name: Install Node.js dependencies
run: |
npm ci
- name: Lint documentation
run: |
npm test