Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions .github/workflows/all_green_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,11 @@ jobs:
linters:
if: github.event_name == 'pull_request'
uses: ./.github/workflows/linters.yml # use the callable linters job to run tests
sanity:
uses: ./.github/workflows/sanity.yml # use the callable sanity job to run tests
units:
uses: ./.github/workflows/units.yml # use the callable units job to run tests
coverage:
name: Unit test coverage
runs-on: ubuntu-latest
needs:
- sanity
- units
- ansible-test
env:
ANSIBLE_CORE_REF: "stable-2.17"
steps:
Expand Down Expand Up @@ -74,28 +69,28 @@ jobs:
with:
name: coverage
path: ${{ github.workspace }}/coverage.xml
ansible-test:
uses: ./.github/workflows/ansible-test.yml

all_green:
if: ${{ always() }}
needs:
- linters
- sanity
- units
- coverage
- ansible-test
runs-on: ubuntu-latest
steps:
- run: |
python -c "
import sys

required = ['sanity', 'units', 'coverage']
required = ['coverage', 'ansible-test']
if '${{ github.event_name }}' == 'pull_request':
required = ['linters', 'sanity', 'units', 'coverage']
required = ['linters', 'coverage', 'ansible-test']
results = {
'linters': '${{ needs.linters.result }}',
'sanity': '${{ needs.sanity.result }}',
'units': '${{ needs.units.result }}',
'coverage': '${{ needs.coverage.result }}',
'ansible-test': '${{ needs.ansible-test.result }}',
}

for name in required:
Expand Down Expand Up @@ -131,10 +126,9 @@ jobs:
- coverage
if: >-
${{ needs.all_green.result == 'success'
&& secrets.ANSIBLE_COLLECTIONS_ORG_SONAR_TOKEN_CICD_BOT != ''
&& (github.event_name == 'push'
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository)) }}
uses: ./.github/workflows/sonarcloud.yml
secrets:
ANSIBLE_COLLECTIONS_ORG_SONAR_TOKEN_CICD_BOT: ${{ secrets.ANSIBLE_COLLECTIONS_ORG_SONAR_TOKEN_CICD_BOT }}
ANSIBLE_COLLECTIONS_ORG_SONAR_TOKEN_CICD_BOT: ${{ secrets.ANSIBLE_COLLECTIONS_ORG_SONAR_TOKEN_CICD_BOT }}
138 changes: 138 additions & 0 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Ansible collection testing with ansible-test-gh-action
#
# Note: Integration tests are handled separately in integration.yml due to
# their complexity and AWS credential requirements.

name: ansible-test

on: [workflow_call] # allow this workflow to be called from other workflows

jobs:
sanity:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ansible-core-version:
- stable-2.17
- stable-2.18
- stable-2.19
- stable-2.20
- stable-2.21
- milestone
- devel
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
exclude:
# Collection does not support ansible-core == 2.16 (omitted from matrix)
# devel and milestone don't support older Python versions
- ansible-core-version: devel
python-version: "3.10"
- ansible-core-version: devel
python-version: "3.11"
- ansible-core-version: milestone
python-version: "3.10"
- ansible-core-version: milestone
python-version: "3.11"
# stable-2.21 excludes
- ansible-core-version: stable-2.21
python-version: "3.10"
- ansible-core-version: stable-2.21
python-version: "3.11"
# stable-2.20 excludes
- ansible-core-version: stable-2.20
python-version: "3.10"
- ansible-core-version: stable-2.20
python-version: "3.14"
# stable-2.19 excludes
- ansible-core-version: stable-2.19
python-version: "3.10"
- ansible-core-version: stable-2.19
python-version: "3.14"
# stable-2.18 excludes
- ansible-core-version: stable-2.18
python-version: "3.10"
- ansible-core-version: stable-2.18
python-version: "3.14"
# stable-2.17 excludes
- ansible-core-version: stable-2.17
python-version: "3.13"
- ansible-core-version: stable-2.17
python-version: "3.14"
steps:
- name: Perform sanity testing
uses: ansible-community/ansible-test-gh-action@d3a8ec7a59694e25e210fcd44738910149537f0e # v1.17.0
with:
ansible-core-version: ${{ matrix.ansible-core-version }}
testing-type: sanity
target-python-version: ${{ matrix.python-version }}
test-deps: -r ansible_collections/amazon/cloud/tests/sanity/requirements.yml

units:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ansible-core-version:
- stable-2.17
- stable-2.18
- stable-2.19
- stable-2.20
- stable-2.21
- milestone
- devel
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
exclude:
# Collection does not support ansible-core == 2.16 (omitted from matrix)
# devel and milestone don't support older Python versions
- ansible-core-version: devel
python-version: "3.10"
- ansible-core-version: devel
python-version: "3.11"
- ansible-core-version: milestone
python-version: "3.10"
- ansible-core-version: milestone
python-version: "3.11"
# stable-2.21 excludes
- ansible-core-version: stable-2.21
python-version: "3.10"
- ansible-core-version: stable-2.21
python-version: "3.11"
# stable-2.20 excludes
- ansible-core-version: stable-2.20
python-version: "3.10"
- ansible-core-version: stable-2.20
python-version: "3.14"
# stable-2.19 excludes
- ansible-core-version: stable-2.19
python-version: "3.10"
- ansible-core-version: stable-2.19
python-version: "3.14"
# stable-2.18 excludes
- ansible-core-version: stable-2.18
python-version: "3.10"
- ansible-core-version: stable-2.18
python-version: "3.14"
# stable-2.17 excludes
- ansible-core-version: stable-2.17
python-version: "3.13"
- ansible-core-version: stable-2.17
python-version: "3.14"
steps:
- name: Perform unit testing
uses: ansible-community/ansible-test-gh-action@d3a8ec7a59694e25e210fcd44738910149537f0e # v1.17.0
with:
ansible-core-version: ${{ matrix.ansible-core-version }}
testing-type: units
target-python-version: ${{ matrix.python-version }}
test-deps: -r ansible_collections/amazon/cloud/tests/unit/requirements.yml
pre-test-cmd: python -m pip install -r tests/unit/constraints.txt -r tests/unit/requirements.txt -r test-requirements.txt
84 changes: 0 additions & 84 deletions .github/workflows/sanity.yml

This file was deleted.

83 changes: 0 additions & 83 deletions .github/workflows/units.yml

This file was deleted.

Loading
Loading