From c63b56da7615d61f6cc80ec10c42bc06241e8262 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 22 Jun 2026 06:15:10 +0200 Subject: [PATCH] CI: Run GHA integration tests with antsibull-nox (#12311) Run GHA integration tests with antsibull-nox. --- .github/workflows/ansible-test.yml | 174 ----------------------------- .github/workflows/nox.yml | 12 ++ README.md | 3 +- 3 files changed, 13 insertions(+), 176 deletions(-) delete mode 100644 .github/workflows/ansible-test.yml diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml deleted file mode 100644 index aafc3a3239..0000000000 --- a/.github/workflows/ansible-test.yml +++ /dev/null @@ -1,174 +0,0 @@ ---- -# Copyright (c) Ansible Project -# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) -# SPDX-License-Identifier: GPL-3.0-or-later - -# For the comprehensive list of the inputs supported by the ansible-community/ansible-test-gh-action GitHub Action, see -# https://github.com/marketplace/actions/ansible-test - -name: EOL CI -"on": - # Run EOL CI against all pushes (direct commits, also merged PRs), Pull Requests - push: - branches: - - main - - stable-* - pull_request: - # Run EOL CI once per day (at 08:00 UTC) - schedule: - - cron: '0 8 * * *' - -concurrency: - # Make sure there is at most one active run per PR, but do not cancel any non-PR runs - group: ${{ github.workflow }}-${{ (github.head_ref && github.event.number) || github.run_id }} - cancel-in-progress: true - -jobs: - sanity: - name: EOL Sanity (Ⓐ${{ matrix.ansible }}) - strategy: - matrix: - ansible: - - '2.18' - runs-on: ubuntu-latest - steps: - - name: Perform sanity testing - uses: felixfontein/ansible-test-gh-action@main - with: - ansible-core-version: stable-${{ matrix.ansible }} - codecov-token: ${{ secrets.CODECOV_TOKEN }} - coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }} - pull-request-change-detection: 'true' - testing-type: sanity - - units: - runs-on: ubuntu-latest - name: EOL Units (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}) - strategy: - # As soon as the first unit test fails, cancel the others to free up the CI queue - fail-fast: true - matrix: - ansible: - - '' - python: - - '' - exclude: - - ansible: '' - include: - - ansible: '2.18' - python: '3.8' - - ansible: '2.18' - python: '3.11' - - ansible: '2.18' - python: '3.13' - - steps: - - name: >- - Perform unit testing against - Ansible version ${{ matrix.ansible }} - uses: felixfontein/ansible-test-gh-action@main - with: - ansible-core-version: stable-${{ matrix.ansible }} - codecov-token: ${{ secrets.CODECOV_TOKEN }} - coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }} - pre-test-cmd: >- - mkdir -p ../../ansible - ; - git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools - pull-request-change-detection: 'true' - target-python-version: ${{ matrix.python }} - testing-type: units - - integration: - runs-on: ubuntu-latest - name: EOL I (Ⓐ${{ matrix.ansible }}+${{ matrix.docker }}+py${{ matrix.python }}:${{ matrix.target }}) - strategy: - fail-fast: false - matrix: - ansible: - - '' - docker: - - '' - python: - - '' - target: - - '' - exclude: - - ansible: '' - include: - # 2.18 - - ansible: '2.18' - docker: fedora40 - python: '' - target: azp/posix/1/ - - ansible: '2.18' - docker: fedora40 - python: '' - target: azp/posix/2/ - - ansible: '2.18' - docker: fedora40 - python: '' - target: azp/posix/3/ - - ansible: '2.18' - docker: ubuntu2404 - python: '' - target: azp/posix/1/ - - ansible: '2.18' - docker: ubuntu2404 - python: '' - target: azp/posix/2/ - - ansible: '2.18' - docker: ubuntu2404 - python: '' - target: azp/posix/3/ - - ansible: '2.18' - docker: alpine320 - python: '' - target: azp/posix/1/ - - ansible: '2.18' - docker: alpine320 - python: '' - target: azp/posix/2/ - - ansible: '2.18' - docker: alpine320 - python: '' - target: azp/posix/3/ - # Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled. - # - ansible: '2.18' - # docker: default - # python: '3.8' - # target: azp/generic/1/ - # - ansible: '2.18' - # docker: default - # python: '3.13' - # target: azp/generic/1/ - - steps: - - name: >- - Perform integration testing against - Ansible version ${{ matrix.ansible }} - under Python ${{ matrix.python }} - uses: felixfontein/ansible-test-gh-action@main - with: - ansible-core-version: stable-${{ matrix.ansible }} - codecov-token: ${{ secrets.CODECOV_TOKEN }} - coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }} - docker-image: ${{ matrix.docker }} - integration-continue-on-error: 'false' - integration-diff: 'false' - integration-retry-on-error: 'true' - # TODO: remove "--branch stable-2" from community.crypto install once we're only using ansible-core 2.17 or newer! - pre-test-cmd: >- - mkdir -p ../../ansible - ; - git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.posix.git ../../ansible/posix - ; - git clone --depth=1 --single-branch --branch stable-2 https://github.com/ansible-collections/community.crypto.git ../../community/crypto - ; - git clone --depth=1 --single-branch https://github.com/ansible-collections/community.docker.git ../../community/docker - ; - git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools - pull-request-change-detection: 'true' - target: ${{ matrix.target }} - target-python-version: ${{ matrix.python }} - testing-type: integration diff --git a/.github/workflows/nox.yml b/.github/workflows/nox.yml index 7c299d10b6..f548c33d74 100644 --- a/.github/workflows/nox.yml +++ b/.github/workflows/nox.yml @@ -26,3 +26,15 @@ jobs: with: session-name: Run extra sanity tests change-detection-in-prs: true + ansible-test: + uses: ansible-community/antsibull-nox/.github/workflows/reusable-nox-matrix.yml@main + with: + change-detection-in-prs: true + upload-codecov: true + upload-codecov-pr: false + upload-codecov-push: false + upload-codecov-schedule: true + allow-coverage-cd-override: true + max-ansible-core: "2.18" + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index dd74ffcc9d..3e9c3387f8 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,7 @@ SPDX-License-Identifier: GPL-3.0-or-later # Community General Collection [![Documentation](https://img.shields.io/badge/docs-brightgreen.svg)](https://docs.ansible.com/projects/ansible/devel/collections/community/general/) -[![Build Status](https://dev.azure.com/ansible/community.general/_apis/build/status/CI?branchName=main)](https://dev.azure.com/ansible/community.general/_build?definitionId=31) -[![EOL CI](https://github.com/ansible-collections/community.general/actions/workflows/ansible-test.yml/badge.svg?branch=main)](https://github.com/ansible-collections/community.general/actions) +[![AZP CI](https://dev.azure.com/ansible/community.general/_apis/build/status/CI?branchName=main)](https://dev.azure.com/ansible/community.general/_build?definitionId=31) [![Nox CI](https://github.com/ansible-collections/community.general/actions/workflows/nox.yml/badge.svg?branch=main)](https://github.com/ansible-collections/community.general/actions) [![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.general)](https://codecov.io/gh/ansible-collections/community.general) [![REUSE status](https://api.reuse.software/badge/github.com/ansible-collections/community.general)](https://api.reuse.software/info/github.com/ansible-collections/community.general)