--- name: Ansible Test on: # yamllint disable-line rule:truthy pull_request: merge_group: branches: - main types: - checks_requested push: branches: - main workflow_dispatch: env: LSR_ROLE2COLL_NAMESPACE: fedora LSR_ROLE2COLL_NAME: linux_system_roles permissions: contents: read jobs: ansible_test: if: | !((github.event_name == 'pull_request' && contains(github.event.pull_request.title, '[citest_skip]')) || (github.event_name == 'push' && contains(github.event.head_commit.message, '[citest_skip]'))) runs-on: ubuntu-latest strategy: fail-fast: false # get all results, not just the first failure matrix: versions: - { ansible: "2-14", python: "3.9" } - { ansible: "2-16", python: "3.11" } - { ansible: "2-17", python: "3.12" } - { ansible: "2-18", python: "3.12" } - { ansible: "2-19", python: "3.13" } - { ansible: "2-20", python: "3.13" } - { ansible: "milestone", python: "3.13" } steps: - name: Update pip, git run: | set -euxo pipefail python3 -m pip install --upgrade pip sudo apt update sudo apt install -y git - name: Checkout repo uses: actions/checkout@v7 - name: Install tox, tox-lsr run: | set -euxo pipefail pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.18.1" - name: Set up Python uses: actions/setup-python@v6 with: python-version: ${{ matrix.versions.python }} - name: Convert role to collection format run: tox -e collection - name: Run ansible-test run: | tox \ -x testenv:ansible-test-${{ matrix.versions.ansible }}.basepython="python${{ matrix.versions.python }}" \ -e ansible-test-${{ matrix.versions.ansible }}