Skip to content

GitHub Action for testing Galaxy import of an Ansible collection

License

Notifications You must be signed in to change notification settings

ansible-community/github-action-test-galaxy-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action for testing importing an Ansible collection with the Galaxy importer

Linting Tests REUSE

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.

Usage

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.gz

Options

The follow options can be provided to this GitHub Action.

artifact-path

Path to the collection's build artifact (tarball).

(REQUIRED)

python-version

The Python version to use.

Note that 3.12 currently does not work due to madpah/requirements-parser#88.

(DEFAULT: 3.11)

ansible-core-version

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)

collection-requirements-path

Path to a Galaxy requirements file. If present, these collections will be installed.

importer-config-path

Path to a Galaxy importer configuration file. See https://github.com/ansible/galaxy-importer#configuration for more information.

Bundled shared workflow

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@main

If 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/bar

Please check out the workflow for other supported options.

License

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.

About

GitHub Action for testing Galaxy import of an Ansible collection

Topics

Resources

License

Stars

Watchers

Forks