lvm: lvm_pv on RHEL 8, role fixes, Molecule scenario and Python 3.6 unit tests #445
Workflow file for this run
This file contains hidden or 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: 'Linuxfabrik: Unit Tests' | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| pull_request: {} | |
| permissions: | |
| contents: 'read' | |
| jobs: | |
| controller-plugins: | |
| name: 'Controller plugins (Python ${{ matrix.python-version }})' | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Controller-side plugins (filter, lookup). The module tests run | |
| # here as well; their Python 3.6 run is the managed-node job below. | |
| python-version: | |
| - '3.9' | |
| - '3.10' | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| steps: | |
| - name: 'Harden the runner (Audit all outbound calls)' | |
| uses: 'step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1' # v2.21.1 | |
| with: | |
| egress-policy: 'audit' | |
| - name: 'Checkout repository' | |
| uses: 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1' # v7.0.1 | |
| # The interpreter tox builds the test env for. Its absolute path is | |
| # handed to tox via `--discover` below, so this step does not rely on | |
| # the executable staying on PATH once the next step runs. | |
| - name: 'Set up the target Python ${{ matrix.python-version }}' | |
| id: 'target-python' | |
| uses: 'actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97' # v7.0.0 | |
| with: | |
| python-version: '${{ matrix.python-version }}' | |
| # The interpreter tox itself runs under. Pinned to one version so that | |
| # a single hash-pinned requirements file covers the whole matrix: | |
| # tox cannot be resolved for 3.9 and 3.10+ at once, because virtualenv | |
| # requires `filelock >= 3.24.2` from 3.10 on and no filelock that new | |
| # supports 3.9. Listed last, so `python` and `pip` refer to it. | |
| - name: 'Set up the Python that runs tox' | |
| uses: 'actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97' # v7.0.0 | |
| with: | |
| python-version: '3.13' | |
| - name: 'Install tox' | |
| run: 'pip install --require-hashes --requirement .github/tox/requirements.txt' | |
| - name: 'Run tox for this Python (all matching ansible-core envs)' | |
| # `-f pyXYZ` selects every tox env carrying this Python's factor, | |
| # e.g. py311 -> py311-ansible215/216/217/218. | |
| run: 'tox --discover "${{ steps.target-python.outputs.python-path }}" -f "py$(echo "${{ matrix.python-version }}" | tr -d ".")"' | |
| managed-node-plugins: | |
| name: 'Managed-node plugins (RHEL 8, Python 3.6)' | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - name: 'Harden the runner (Audit all outbound calls)' | |
| uses: 'step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1' # v2.21.1 | |
| with: | |
| egress-policy: 'audit' | |
| - name: 'Checkout repository' | |
| uses: 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1' # v7.0.1 | |
| # Modules run on the managed node, down to the platform-python 3.6 of | |
| # RHEL 8, which no runner ships. Same test run as the py36-target env | |
| # in tox.ini, without tox, since tox 4 does not run on Python 3.6. | |
| - name: 'Run the module tests on UBI 8' | |
| run: | | |
| docker run --rm --volume "${PWD}:/src:ro" --workdir /src \ | |
| --env PYTEST_ADDOPTS='-p no:cacheprovider' \ | |
| registry.access.redhat.com/ubi8/ubi \ | |
| bash -c ' | |
| set -o errexit | |
| dnf --assumeyes --quiet install python3 python3-pip | |
| python3 -m venv /tmp/venv | |
| /tmp/venv/bin/pip install --require-hashes --requirement .github/unit-tests-py36/bootstrap.txt | |
| /tmp/venv/bin/pip install --require-hashes --requirement .github/unit-tests-py36/requirements.txt | |
| /tmp/venv/bin/pytest --import-mode=prepend tests/unit/plugins/modules tests/unit/plugins/module_utils | |
| ' |