@ -2,6 +2,10 @@
name : Tests
name : Tests
# env:
# ANSIBLE_VERBOSITY: 3
# MITOGEN_LOG_LEVEL: DEBUG
on :
on :
pull_request:
pull_request:
push:
push:
@ -11,10 +15,10 @@ on:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/runner-images/blob/main/README.md#software-and-image-support
# https://github.com/actions/runner-images/blob/main/README.md#software-and-image-support
jobs:
jobs:
u2 0 04:
u2 2 04:
name : u2 0 04 ${{ matrix.tox_env }}
name : u2 2 04 ${{ matrix.tox_env }}
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2 0 04-Readme.md
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2 2 04-Readme.md
runs-on : ubuntu-2 0 .04
runs-on : ubuntu-2 2 .04
strategy:
strategy:
fail-fast : false
fail-fast : false
@ -32,6 +36,115 @@ jobs:
python_version : '3.6'
python_version : '3.6'
tox_env : py36-mode_ansible-ansible4
tox_env : py36-mode_ansible-ansible4
- name : Mito_27
tox_env : py27-mode_mitogen
- name : Mito_36
python_version : '3.6'
tox_env : py36-mode_mitogen
steps:
- uses : actions/checkout@v4
- uses : docker/login-action@v3
with:
registry : ghcr.io
username : ${{ github.actor }}
password : ${{ secrets.GITHUB_TOKEN }}
- name : Install build deps
run : |
set -o errexit -o nounset -o pipefail
PYTHON=$(python -c 'import re; print(re.sub(r"^py([23])([0-9]{1,2}).*", r"python\1.\2", "${{ matrix.tox_env }}"))')
if [[ -z $PYTHON ]]; then
echo 1>&2 "Python interpreter could not be determined"
exit 1
fi
sudo apt-get update
if [[ $PYTHON == "python2.7" ]]; then
sudo apt install -y python2-dev sshpass virtualenv
elif [[ $PYTHON == "python3.6" ]]; then
sudo apt install -y gcc-10 make libbz2-dev liblzma-dev libreadline-dev libsqlite3-dev libssl-dev sshpass virtualenv zlib1g-dev
curl --fail --silent --show-error --location https://pyenv.run | bash
CC=gcc-10 ~/.pyenv/bin/pyenv install --force 3.6
else
echo 1>&2 "Python interpreter $PYTHON not available"
exit 1
fi
- name : Show Python versions
run : |
set -o errexit -o nounset -o pipefail
# macOS builders lack a realpath command
type python && python -c"import os.path;print(os.path.realpath('$(type -p python)'))" && python --version
type python2 && python2 -c"import os.path;print(os.path.realpath('$(type -p python2)'))" && python2 --version
type python3 && python3 -c"import os.path;print(os.path.realpath('$(type -p python3)'))" && python3 --version
echo
if [ -e /usr/bin/python ]; then
echo "/usr/bin/python: sys.executable: $(/usr/bin/python -c 'import sys; print(sys.executable)')"
fi
if [ -e /usr/bin/python2 ]; then
echo "/usr/bin/python2: sys.executable: $(/usr/bin/python2 -c 'import sys; print(sys.executable)')"
fi
if [ -e /usr/bin/python2.7 ]; then
echo "/usr/bin/python2.7: sys.executable: $(/usr/bin/python2.7 -c 'import sys; print(sys.executable)')"
fi
- name : Install tooling
run : |
set -o errexit -o nounset -o pipefail
# Tox environment name (e.g. py312-mode_mitogen) -> Python executable name (e.g. python3.12)
PYTHON=$(python -c 'import re; print(re.sub(r"^py([23])([0-9]{1,2}).*", r"python\1.\2", "${{ matrix.tox_env }}"))')
if [[ -z $PYTHON ]]; then
echo 1>&2 "Python interpreter could not be determined"
exit 1
fi
if [[ $PYTHON == "python2.7" ]]; then
curl "https://bootstrap.pypa.io/pip/2.7/get-pip.py" --output "get-pip.py"
"$PYTHON" get-pip.py --user --no-python-version-warning
# Avoid Python 2.x pip masking system pip
rm -f ~/.local/bin/{easy_install,pip,wheel}
elif [[ $PYTHON == "python3.6" ]]; then
PYTHON="$HOME/.pyenv/versions/3.6.15/bin/python3.6"
fi
"$PYTHON" -m pip install -r "tests/requirements-tox.txt"
- name : Run tests
env:
GITHUB_ACTOR : ${{ github.actor }}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
run : |
set -o errexit -o nounset -o pipefail
# Tox environment name (e.g. py312-mode_mitogen) -> Python executable name (e.g. python3.12)
PYTHON=$(python -c 'import re; print(re.sub(r"^py([23])([0-9]{1,2}).*", r"python\1.\2", "${{ matrix.tox_env }}"))')
if [[ -z $PYTHON ]]; then
echo 1>&2 "Python interpreter could not be determined"
exit 1
fi
if [[ $PYTHON == "python3.6" ]]; then
PYTHON="$HOME/.pyenv/versions/3.6.15/bin/python3.6"
fi
"$PYTHON" -m tox -e "${{ matrix.tox_env }}"
u2404:
name : u2404 ${{ matrix.tox_env }}
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
runs-on : ubuntu-24.04
strategy:
fail-fast : false
matrix:
include:
- name : Ans_311_210
- name : Ans_311_210
python_version : '3.11'
python_version : '3.11'
tox_env : py311-mode_ansible-ansible2.10
tox_env : py311-mode_ansible-ansible2.10
@ -67,11 +180,6 @@ jobs:
python_version : '3.13'
python_version : '3.13'
tox_env : py313-mode_ansible-ansible11-strategy_linear
tox_env : py313-mode_ansible-ansible11-strategy_linear
- name : Mito_27
tox_env : py27-mode_mitogen
- name : Mito_36
python_version : '3.6'
tox_env : py36-mode_mitogen
- name : Mito_313
- name : Mito_313
python_version : '3.13'
python_version : '3.13'
tox_env : py313-mode_mitogen
tox_env : py313-mode_mitogen
@ -92,7 +200,7 @@ jobs:
set -o errexit -o nounset -o pipefail
set -o errexit -o nounset -o pipefail
sudo apt-get update
sudo apt-get update
sudo apt-get install -y python2-dev python3-pip sshpass virtualenv
sudo apt-get install -y sshpass virtualenv
- name : Show Python versions
- name : Show Python versions
run : |
run : |
set -o errexit -o nounset -o pipefail
set -o errexit -o nounset -o pipefail
@ -126,18 +234,7 @@ jobs:
exit 1
exit 1
fi
fi
if [[ $PYTHON == "python2.7" && $(uname) == "Darwin" ]]; then
"$PYTHON" -m pip install -r "tests/requirements-tox.txt"
"$PYTHON" -m ensurepip --user --altinstall --no-default-pip
"$PYTHON" -m pip install --user -r "tests/requirements-tox.txt"
elif [[ $PYTHON == "python2.7" ]]; then
curl "https://bootstrap.pypa.io/pip/2.7/get-pip.py" --output "get-pip.py"
"$PYTHON" get-pip.py --user --no-python-version-warning
# Avoid Python 2.x pip masking system pip
rm -f ~/.local/bin/{easy_install,pip,wheel}
"$PYTHON" -m pip install --user -r "tests/requirements-tox.txt"
else
"$PYTHON" -m pip install -r "tests/requirements-tox.txt"
fi
- name : Run tests
- name : Run tests
env:
env:
GITHUB_ACTOR : ${{ github.actor }}
GITHUB_ACTOR : ${{ github.actor }}
@ -240,7 +337,8 @@ jobs:
check:
check:
if : always()
if : always()
needs:
needs:
- u2004
- u2204
- u2404
- macos
- macos
runs-on : ubuntu-latest
runs-on : ubuntu-latest
steps:
steps: