A composite GitHub Action that allows to test importing a built Ansible collection with the Galaxy importer in GitHub Actions CI/CD workflows.
While this action can be used directly in workflows, we suggest to use the bundled shared workflow.
This action is covered by the Ansible Code of Conduct.
To use the action, add the following step to your workflow file (for example .github/workflows/galaxy-import.yml):
- name: Test collection import
uses: ansible-community/github-action-test-galaxy-import@main
with:
artifact-path: /path/to/foo-bar-1.0.0.tar.gzThe follow options can be provided to this GitHub Action.
Path to the collection's build artifact (tarball).
(REQUIRED)
The Python version to use.
Note that 3.12 currently does not work due to madpah/requirements-parser#88.
(DEFAULT: 3.11)
The branch of tag name of ansible-core to install. This is assumed to exist in https://github.com/ansible/ansible.
(DEFAULT: stable-2.16)
Path to a Galaxy requirements file. If present, these collections will be installed.
Path to a Galaxy importer configuration file. See https://github.com/ansible/galaxy-importer#configuration for more information.
This GitHub Action bundles a shared workflow, test-galaxy-import.yml, which allows you to build a collection and test importing it with the Galaxy importer.
name: import-galaxy
'on':
# Run CI against all pushes (direct commits, also merged PRs) to main and the stable-* branches, and all Pull Requests
push:
branches:
- main
- stable-*
pull_request:
jobs:
import-galaxy:
permissions:
contents: read
name: Import collection with Galaxy importer
uses: ansible-community/github-action-test-galaxy-import/.github/workflows/test-galaxy-import.yml@mainIf your collection's root (where galaxy.yml is) is in a subdirectory of the repository, use the subdirectory option:
jobs:
import-galaxy:
permissions:
contents: read
name: Import collection with Galaxy importer
uses: ansible-community/github-action-test-galaxy-import/.github/workflows/test-galaxy-import.yml@main
with:
subdirectory: ansible_collections/foo/barPlease check out the workflow for other supported options.
This action is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later.
See LICENSES/GPL-3.0-or-later.txt for the full text.
All files have a machine readable SDPX-License-Identifier: comment denoting its respective license(s) or an equivalent entry in an accompanying .license file. This conforms to the REUSE specification.