Skip to content

CI

CI #406

Workflow file for this run

---
name: CI
on:
# Run CI against all pushes (direct commits, also merged PRs), Pull Requests
push:
branches:
- stable-*
pull_request:
schedule:
- cron: '0 6 * * *'
concurrency:
group: >-
${{ github.workflow }}-${{
github.event.pull_request.number || github.sha
}}
cancel-in-progress: true
jobs:
###
# Sanity tests (REQUIRED)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html
sanity:
name: Sanity (Ⓐ${{ matrix.ansible }})
strategy:
matrix:
ansible:
- stable-2.17
- stable-2.18
- devel
# - milestone
runs-on: ubuntu-latest
steps:
- name: Perform sanity testing
id: sanity_tests
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
testing-type: sanity
codecov-token: ${{ secrets.CODECOV_TOKEN }}
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
pull-request-change-detection: true
###
# Unit tests (OPTIONAL)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_units.html
units:
runs-on: ubuntu-latest
name: Units (Ⓐ${{ matrix.ansible }})
strategy:
fail-fast: true
matrix:
ansible:
- stable-2.17
- stable-2.18
- devel
# - milestone
steps:
- name: >-
Perform unit testing against
Ansible version ${{ matrix.ansible }}
id: units_tests
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
testing-type: units
test-deps: >-
ansible.netcommon
ansible.utils
pull-request-change-detection: true
###
# Integration tests (RECOMMENDED)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html
integration:
runs-on: ubuntu-latest
name: Integration (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
strategy:
fail-fast: false
matrix:
ansible:
- devel
# - milestone
python:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
include:
- ansible: stable-2.17
python: '3.7'
- ansible: stable-2.17
python: '3.8'
- ansible: stable-2.17
python: '3.9'
- ansible: stable-2.17
python: '3.10'
- ansible: stable-2.17
python: '3.11'
- ansible: stable-2.17
python: '3.12'
# ansible-core 2.18
- ansible: stable-2.18
python: '3.8'
- ansible: stable-2.18
python: '3.9'
- ansible: stable-2.18
python: '3.10'
- ansible: stable-2.18
python: '3.11'
- ansible: stable-2.18
python: '3.12'
- ansible: stable-2.18
python: '3.13'
steps:
- name: >-
Perform integration testing against
Ansible version ${{ matrix.ansible }}
under Python ${{ matrix.python }}
id: integration_tests
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
target-python-version: ${{ matrix.python }}
testing-type: integration
test-deps: ansible.netcommon
pull-request-change-detection: true
###
# Docker Integration tests (OPTIONAL)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html
docker-integration:
runs-on: ubuntu-latest
name: Docker Integration (Ⓐ${{ matrix.ansible }}+image-${{ matrix.image }})
strategy:
fail-fast: false
matrix:
ansible:
- stable-2.18
# - milestone
image:
- alpine320
- fedora40
- ubuntu2204
- ubuntu2404
steps:
- name: >-
Perform integration testing against
Ansible version ${{ matrix.ansible }}
on Docker image ${{ matrix.image }}
id: docker_integration_tests
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
docker-image: ${{ matrix.image }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
testing-type: integration
test-deps: ansible.netcommon
pull-request-change-detection: true
check: # This job does nothing and is only used for the branch protection
# or multi-stage CI jobs, like making sure that all tests pass before
# a publishing job is started.
if: always()
needs:
- sanity
- units
- integration
- docker-integration
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}