Skip to content

doc: prepare for the next release #840

doc: prepare for the next release

doc: prepare for the next release #840

Workflow file for this run

name: Testing
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pytest:
name: Tests Py${{ matrix.python-version }} - Ansible ${{ matrix.ansible-core-version }}
env:
SVG_FILES_PATH: tests/generated-svgs
MERMAID_FILES_PATH: tests/generated-mermaids
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# See https://www.ansible.com/blog/ansible-3.0.0-qa and https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html
include:
- ansible-core-version: '2.16.*'
python-version: '3.10'
- ansible-core-version: '2.16.*'
python-version: '3.11'
- ansible-core-version: '2.17.*'
python-version: '3.10'
- ansible-core-version: '2.17.*'
python-version: '3.11'
- ansible-core-version: '2.18.*'
python-version: '3.11'
- ansible-core-version: '2.18.*'
python-version: '3.12'
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Setup Python ${{ matrix.python-version }}
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install prereqs
run: |
pip install -q ansible-core=='${{ matrix.ansible-core-version }}' virtualenv setuptools wheel coveralls
pip install -q -r requirements.txt -r tests/requirements_tests.txt
pip freeze
sudo apt-get install -yq graphviz
cd tests/fixtures
ansible-galaxy install -r requirements.yml
- name: Pytest
env:
PY_COLORS: "1"
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.ref }}
run: make test
- name: Set variables
run: |
matrix_ansible_version='${{ matrix.ansible-core-version }}'
clean_version=${matrix_ansible_version//.\*/} # Remove '.*' from the version name
echo "MATRIX_JOB_IDENTIFIER=py${{ matrix.python-version }}-ansible-${clean_version}" >> $GITHUB_ENV
- name: Upload generated SVGs as artefacts
uses: actions/upload-artifact@v4
with:
name: generated-svgs-${{ env.MATRIX_JOB_IDENTIFIER }}
path: ${{ env.SVG_FILES_PATH }}/
if-no-files-found: error # the tests should generate SVGs files
- name: Publish job summary
run: python tests/generate-job-summary.py >> $GITHUB_STEP_SUMMARY
- name: Test installation in virtualenv
run: make test_install ANSIBLE_CORE_VERSION=${{ matrix.ansible-core-version }}
- name: Upload Coverage
run: cd tests && coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: py${{ matrix.python-version }}-ansible${{ matrix.ansible-core-version }}
COVERALLS_PARALLEL: true
coveralls:
runs-on: ubuntu-latest
name: Finish coverage
needs: pytest
container: python:3-slim # just need a simple python container to finish the coverage
steps:
- name: Coveralls finish
run: pip install coveralls && coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}