{"id":13686518,"url":"https://github.com/ansible-community/ansible-test-gh-action","last_synced_at":"2025-04-04T10:07:45.264Z","repository":{"id":44667274,"uuid":"313716561","full_name":"ansible-community/ansible-test-gh-action","owner":"ansible-community","description":"A composite GitHub Action encapsulating the GitHub Actions CI/CD workflows setup necessary for testing Ansible collection repositories on GitHub","archived":false,"fork":false,"pushed_at":"2025-01-06T18:09:33.000Z","size":265,"stargazers_count":26,"open_issues_count":9,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-28T09:07:26.020Z","etag":null,"topics":["actions","ansible","ansible-test","github","github-action","github-actions","hacktoberfest","idiomatic","idiomatic-ansible"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/ansible-test","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ansible-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-17T19:06:36.000Z","updated_at":"2025-02-01T18:57:31.000Z","dependencies_parsed_at":"2023-02-15T22:15:32.423Z","dependency_job_id":"2b8ec1f4-3a42-42b5-85a4-8848b680ebb8","html_url":"https://github.com/ansible-community/ansible-test-gh-action","commit_stats":{"total_commits":138,"total_committers":8,"mean_commits":17.25,"dds":"0.35507246376811596","last_synced_commit":"ef8df300d21a213b4160d5f2c43e0e678af946ee"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-community%2Fansible-test-gh-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-community%2Fansible-test-gh-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-community%2Fansible-test-gh-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-community%2Fansible-test-gh-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ansible-community","download_url":"https://codeload.github.com/ansible-community/ansible-test-gh-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157281,"owners_count":20893220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","ansible","ansible-test","github","github-action","github-actions","hacktoberfest","idiomatic","idiomatic-ansible"],"created_at":"2024-08-02T15:00:34.322Z","updated_at":"2025-04-04T10:07:45.243Z","avatar_url":"https://github.com/ansible-community.png","language":"Python","funding_links":[],"categories":["github"],"sub_categories":[],"readme":"[![🧪 GitHub Actions CI/CD workflow tests badge]][GHA workflow runs list]\n[![pre-commit.ci status badge]][pre-commit.ci results page]\n\n# ansible-test-gh-action for setting up CI in Ansible Collection repositories\n\nA composite GitHub Action encapsulating the GitHub Actions CI/CD workflows\nsetup necessary for testing Ansible collection repositories on GitHub.\n\n\n## Usage\n\nTo use the action add the following step to your workflow file (e.g.\n`.github/workflows/ansible-test.yml`)\n\n```yaml\n- name: Perform integration testing with ansible-test\n  uses: ansible-community/ansible-test-gh-action@release/v1\n  with:\n    ansible-core-version: stable-2.14\n    pre-test-cmd: echo This runs before the ansible-test invocation\n    target-python-version: 3.11\n    controller-python-version: auto\n    testing-type: integration\n    test-deps: ansible.netcommon\n- name: Perform sanity testing with ansible-test\n  uses: ansible-community/ansible-test-gh-action@release/v1\n  with:\n    ansible-core-version: stable-2.14\n    testing-type: sanity\n- name: Perform unit testing with ansible-test\n  uses: ansible-community/ansible-test-gh-action@release/v1\n  with:\n    ansible-core-version: stable-2.14\n    pre-test-cmd: echo This runs before the ansible-test invocation\n    target-python-version: 3.11\n    testing-type: units\n    test-deps: \u003e-\n      ansible.netcommon\n      ansible.utils\n```\n\n\u003e **Pro tip**: instead of using branch pointers, like `main`, pin\nversions of Actions that you use to tagged versions or SHA-1 commit\nidentifiers. This will make your workflows more secure and better\nreproducible, saving you from sudden and unpleasant surprises.\n\n\n## Options\n\n\n### `ansible-core-version`\n\n`ansible-core` Git revision. See https://github.com/ansible/ansible/tags\nand https://github.com/ansible/ansible/branches/all?query=stable- for\nideas. The repository this refers to can be changed with the\n`ansible-core-github-repository-slug` option. **(DEFAULT: `stable-2.14`)**\n\n\n### `ansible-core-github-repository-slug`\n\nThe GitHub repository slug from which to check out ansible-core\n**(DEFAULT: `ansible/ansible`)**\n\n\n### `codecov-token`\n\nThe Codecov token to use when uploading coverage data. **(OPTIONAL)**\n\n\n### `controller-python-version`\n\nController Python version. This is only used for integration tests and\nansible-core 2.12 or later when `target-python-version` is also specified\n**(DEFAULT: `auto`)**\n\n\n### `collection-root`\n\nPath to collection root relative to repository root **(DEFAULT: `.`)**\n\n\n### `collection-src-directory`\n\nA pre-checked out collection directory that's already on disk\n**(OPTIONAL, substitutes getting the source from the remote Git\nrepository if set, also this action will not attempt to mutate\nits contents)**\n\n\n### `coverage`\n\nWhether to collect and upload coverage information. Can be set to\n`always`, `never`, and `auto`. The value `auto` will upload coverage\ninformation except when `pull-request-change-detection` is set to `true`\nand the action is called from a Pull Request. **(DEFAULT: `auto`)**\n\n\u003e [!NOTE]\n\u003e Coverage is only generated for modules and plugins. If your collection does\n\u003e not contain any modules or plugins, set this to `never` to avoid errors in\n\u003e the codecov upload step due to no coverage information being available.\n\n\n### `docker-image`\n\nA container image spawned by `ansible-test` **(OPTIONAL)**\n\n\n### `git-checkout-ref`\n\nCommittish to check out, unused if `collection-src-directory`\nis set **(OPTIONAL)**\n\n\n### `integration-continue-on-error`\n\nWhether the continue with the other integration tests when an error occurs.\nIf set to `false`, will stop on the first error. When set to `false` and\n`coverage=auto`, code coverage uploading will be disabled.\n**(DEFAULT: `true`)**\n\n\n### `integration-diff`\n\nWhether to show diff output when calling actions in integration tests.\nActions can override this by specifying `diff: false` or `diff: true`.\n**(DEFAULT: `true`)**\n\n\n### `integration-retry-on-error`\n\nWhether to retry the current integration test once when an error happens.\n**(DEFAULT: `true`)**\n\n\n### `origin-python-version`\n\nEnvironment Python version. The value `auto` uses the maximum Python\nversion supported by the given `ansible-core-version` **(DEFAULT: `auto`)**\n\n\n### `pre-test-cmd`\n\nExtra command to invoke before ansible-test **(OPTIONAL)**\n\n\n### `pull-request-change-detection`\n\nWhether to use change detection for pull requests. If set to `true`, will\nuse change detection to determine changed files against the target branch,\nand will not upload code coverage results. If the invocation is not from a\npull request, this option is ignored. Note that this requires\n`collection-src-directory` to be empty, or it has to be a git repository\ncheckout where `collection-src-directory`/`collection-root` ends with\n`ansible_collections/{namespace}/{name}`, or it has to be a git\nrepository checkout where `collection-root` is `.`. **(DEFAULT: `false`)**\n\n\n### `python-version`\n\n**(DEPRECATED)** Use `origin-python-version` instead.\n\n\n### `sanity-tests`\n\nComma-separated list of sanity tests to run. If not present, all applicable tests are run.\n\n\n### `sanity-skip-tests`\n\nComma-separated list of sanity tests to skip.\n\n\n### `sanity-allow-disabled`\n\nAllow running sanity tests that are disabled by default.\n**(DEFAULT: `false`)**\n\n\n### `target`\n\n`ansible-test` TARGET **(OPTIONAL)**\n\n\n### `target-python-version`\n\nTarget Python version **(OPTIONAL)**\n\n\n### `testing-type`\n\n`ansible-test` subcommand **(REQUIRED, Must be one of 'sanity', 'units'\nor 'integration')**\n\n\n### `test-deps`\n\nTest dependencies to install along with this collection **(OPTIONAL)**\n\n\n## Outputs\n\n\n### `ansible-playbook-executable`\n\nPath to the auto-installed `ansible-playbook` executable\n\n\n### `ansible-test-executable`\n\nPath to the auto-installed `ansible-test` executable\n\n\n### `checkout-directory`\n\nPath to the auto-downloaded collection src directory\n\n\n### `collection-fqcn`\n\nDetected collection FQCN\n\n\n### `collection-name`\n\nDetected collection name\n\n\n### `collection-namespace`\n\nDetected collection namespace\n\n\n### `coverage-report-files`\n\nA comma-separated list of produced Cobertura XML coverage report file paths\n\n\n### `origin-python-path`\n\nThe [`python-path` output value][`python-path`] of the [setup-python] action\n\n\n### `origin-python-version`\n\nThe actual value of `origin-python-version` passed to the [setup-python] action\n\n\n### `test-result-files`\n\nA comma-separated list of produced JUnit XML test result file paths\n\n\n## Related community projects\n\nCheck out the [Data-Bene/ansible-test-versions-gh-action] to explore\na semi-automatic job matrix generation for testing your collections. This\nproject is not maintained by us but it is a rather promising way of\nconfiguring your GitHub Actions CI/CD workflows.\n\n[🧪 GitHub Actions CI/CD workflow tests badge]:\nhttps://github.com/ansible-community/ansible-test-gh-action/actions/workflows/test-action.yml/badge.svg?branch=main\u0026event=push\n[GHA workflow runs list]: https://github.com/ansible-community/ansible-test-gh-action/actions/workflows/test-action.yml?query=branch%3Amain\n\n[pre-commit.ci results page]:\nhttps://results.pre-commit.ci/latest/github/ansible-community/ansible-test-gh-action/main\n[pre-commit.ci status badge]:\nhttps://results.pre-commit.ci/badge/github/ansible-community/ansible-test-gh-action/main.svg\n\n[`python-path`]:\nhttps://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#python-path\n[setup-python]: https://github.com/actions/setup-python/#readme\n\n[Data-Bene/ansible-test-versions-gh-action]:\nhttps://github.com/Data-Bene/ansible-test-versions-gh-action\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansible-community%2Fansible-test-gh-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fansible-community%2Fansible-test-gh-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansible-community%2Fansible-test-gh-action/lists"}