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: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||||
ansible
|
ansible ansible-lint
|
||||||
|
|
||||||
- name: Install Poetry
|
- name: Install Poetry
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
22
tests.sh
22
tests.sh
|
|
@ -1,8 +1,24 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
# Pytests
|
||||||
poetry run pytest -vvvv --cov=enroll --cov-report=term-missing --disable-warnings
|
poetry run pytest -vvvv --cov=enroll --cov-report=term-missing --disable-warnings
|
||||||
|
|
||||||
poetry run enroll enroll --harvest /tmp/bundle --out /tmp/ansible && \
|
BUNDLE_DIR="/tmp/bundle"
|
||||||
cd /tmp/ansible && \
|
ANSIBLE_DIR="/tmp/ansible"
|
||||||
sudo ansible-playbook playbook.yml -i "localhost," -c local --check --diff
|
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