Fix: exclude matrix combination of python3.10 and devel #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit tests, dependencies from source | ||
on: | ||
workflow_call: | ||
inputs: | ||
collection_pre_install: | ||
required: false | ||
type: string | ||
default: "" | ||
matrix_exclude: | ||
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix | ||
# 2.15 supports Python 3.9-3.11 | ||
# 2.16 supports Python 3.10-3.12 | ||
# https://docs.ansible.com/ansible/devel/roadmap/ROADMAP_2_17.html | ||
# milestone is 2.18 | ||
# devel is 2.18 until xxxx-xx-xx | ||
default: >- | ||
[ | ||
{ | ||
"ansible-version": "stable-2.16", | ||
"python-version": "3.9" | ||
}, | ||
{ | ||
"ansible-version": "stable-2.17", | ||
"python-version": "3.9" | ||
}, | ||
{ | ||
"ansible-version": "milestone", | ||
"python-version": "3.9" | ||
}, | ||
{ | ||
"ansible-version": "devel", | ||
"python-version": "3.9" | ||
}, | ||
{ | ||
"ansible-version": "devel", | ||
"python-version": "3.10" | ||
}, | ||
{ | ||
"ansible-version": "milestone", | ||
"python-version": "3.10" | ||
}, | ||
{ | ||
- "ansible-version": "stable-2.15", | ||
- "python-version": "3.12" | ||
- } | ||
] | ||
required: false | ||
type: string | ||
jobs: | ||
unit_source: | ||
env: | ||
PY_COLORS: "1" | ||
source_directory: "./source" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ansible-version: | ||
- stable-2.15 | ||
- stable-2.16 | ||
- stable-2.17 | ||
- milestone | ||
- devel | ||
python-version: | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
exclude: ${{ fromJSON(inputs.matrix_exclude) }} | ||
continue-on-error: ${{ matrix.ansible-version == 'devel' }} | ||
name: "py${{ matrix.python-version }} / ${{ matrix.ansible-version }}" | ||
steps: | ||
- name: Checkout the collection repository | ||
uses: ansible-network/github_actions/.github/actions/checkout_dependency@main | ||
with: | ||
path: ${{ env.source_directory }} | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: "0" | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
# ansible-pylibssh does not have cp312 wheels | ||
# when building from sdist libssh-dev needs to be installed | ||
# extra install step starts | ||
- name: Install build toolchain and openssl headers on Linux | ||
shell: bash | ||
run: sudo apt update && sudo apt install build-essential libssl-dev | ||
if: ${{ matrix.python-version == 3.12 }} | ||
- name: Install catchsegv and libssh headers on Linux for cythonize+coverage | ||
shell: bash | ||
run: sudo apt update && sudo apt install libssh-dev | ||
if: ${{ matrix.python-version == 3.12 }} | ||
# extra install step ends | ||
- name: Install ansible-core (${{ matrix.ansible-version }}) | ||
run: python3 -m pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check | ||
- name: Pre install collections dependencies first so the collection install does not | ||
run: ansible-galaxy collection install --pre ${{ inputs.collection_pre_install }} -p /home/runner/collections | ||
if: inputs.collection_pre_install != '' | ||
- name: Read collection metadata from galaxy.yml | ||
id: identify | ||
uses: ansible-network/github_actions/.github/actions/identify_collection@main | ||
with: | ||
source_path: ${{ env.source_directory }} | ||
- name: Build and install the collection | ||
uses: ansible-network/github_actions/.github/actions/build_install_collection@main | ||
with: | ||
install_python_dependencies: true | ||
source_path: ${{ env.source_directory }} | ||
collection_path: ${{ steps.identify.outputs.collection_path }} | ||
tar_file: ${{ steps.identify.outputs.tar_file }} | ||
ansible_version: ${{ matrix.ansible-version }} | ||
- name: Print the ansible version | ||
run: ansible --version | ||
- name: Print the python dependencies | ||
run: python3 -m pip list | ||
- name: Run unit tests | ||
run: python -m pytest tests/unit --showlocals --ansible-host-pattern localhost | ||
working-directory: ${{ steps.identify.outputs.collection_path }} |