Add ansible-lint in tests
This commit is contained in:
parent
4cdc78915f
commit
3f0e38dadf
2 changed files with 20 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ jobs:
|
|||
run: |
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
ansible
|
||||
ansible ansible-lint
|
||||
|
||||
- name: Install Poetry
|
||||
run: |
|
||||
|
|
|
|||
22
tests.sh
22
tests.sh
|
|
@ -1,8 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
# Pytests
|
||||
poetry run pytest -vvvv --cov=enroll --cov-report=term-missing --disable-warnings
|
||||
|
||||
poetry run enroll enroll --harvest /tmp/bundle --out /tmp/ansible && \
|
||||
cd /tmp/ansible && \
|
||||
sudo ansible-playbook playbook.yml -i "localhost," -c local --check --diff
|
||||
BUNDLE_DIR="/tmp/bundle"
|
||||
ANSIBLE_DIR="/tmp/ansible"
|
||||
rm -rf "${BUNDLE_DIR}" "${ANSIBLE_DIR}"
|
||||
|
||||
# Generate data
|
||||
poetry run \
|
||||
enroll enroll \
|
||||
--harvest "${BUNDLE_DIR}" \
|
||||
--out "${ANSIBLE_DIR}"
|
||||
|
||||
builtin cd "${ANSIBLE_DIR}"
|
||||
|
||||
# Lint
|
||||
ansible-lint "${ANSIBLE_DIR}"
|
||||
|
||||
# Run
|
||||
sudo ansible-playbook playbook.yml -i "localhost," -c local --check --diff
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue