46 lines
1.5 KiB
YAML
46 lines
1.5 KiB
YAML
version: '3'
|
|
|
|
tasks:
|
|
modules:
|
|
desc: run `ansible-test sanity` on collections to find common issues for modules and collections
|
|
dir: ansible_collections
|
|
vars:
|
|
ANSIBLE_COLLECTIONS:
|
|
sh: find -mindepth 2 -maxdepth 2 -type d
|
|
cmds:
|
|
- for: { var: ANSIBLE_COLLECTIONS }
|
|
task: 'test:module:sanity'
|
|
vars:
|
|
COLLECTION_PATH: 'ansible_collections/{{.ITEM}}'
|
|
|
|
module:sanity:
|
|
internal: true
|
|
dir: '{{.COLLECTION_PATH}}'
|
|
cmds:
|
|
- 'test -d tests && {{.PYTHON_WRAPPER}} ansible-test sanity --venv || echo - ignored $(pwd)'
|
|
|
|
collections:
|
|
desc: run molecule tests for all roles and collections.
|
|
dir: ansible_collections
|
|
vars:
|
|
ANSIBLE_COLLECTIONS:
|
|
sh: find -mindepth 2 -maxdepth 2 -type d
|
|
cmds:
|
|
- for: { var: ANSIBLE_COLLECTIONS }
|
|
task: 'test:collection:molecule'
|
|
vars:
|
|
COLLECTION_PATH: 'ansible_collections/{{.ITEM}}'
|
|
|
|
collection:molecule:
|
|
internal: true
|
|
dir: '{{.COLLECTION_PATH}}/extensions'
|
|
cmds:
|
|
- 'test -d molecule && {{.PYTHON_WRAPPER}} molecule test || echo - ignored $(pwd)'
|
|
|
|
module:github_artifact:
|
|
desc: run a module from the collection for testing purposes
|
|
vars:
|
|
PLUGINS_DIR: '{{.ROOT_DIR}}/ansible_collections/nullified/infrastructure/plugins'
|
|
cmd: |
|
|
{{.PYTHON_WRAPPER}} python3 {{.PLUGINS_DIR}}/modules/github_artifact.py {{.PLUGINS_DIR}}/tests/github_artifact.json |
|
|
{{.PYTHON_WRAPPER}} python3 -m json.tool | {{.PYTHON_WRAPPER}} pygmentize -l json
|