Skip to content

Commit 2b65885

Browse files
authored
Allow to install test dependencies (#26)
* Install dependencies also for lint * Install ansible-lint directly * Install role requirements so we can lint them
1 parent 2c6c295 commit 2b65885

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.github/workflows/ansible-integration-workflow.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,17 @@ jobs:
5353
- name: Checkout
5454
uses: actions/checkout@v3
5555

56+
- name: Install ansible-lint
57+
run: pip install ansible-lint
58+
59+
- name: Install Ansible Role Requirements
60+
run: |
61+
if test -f "requirements.yml"; then
62+
ansible-galaxy install -r requirements.yml
63+
fi
64+
5665
- name: Ansible Lint
57-
uses: ansible-community/ansible-lint-action@v6
66+
run: ansible-lint .
5867

5968
test:
6069
name: Molecule
@@ -76,6 +85,11 @@ jobs:
7685
# Writing molecule config for docker
7786
echo "${{ inputs.molecule-config}}" > molecule/github/molecule.yml
7887
88+
# Copy test dependencies if they exist
89+
if test -f "molecule/default/requirements.yml"; then
90+
cp molecule/default/requirements.yml molecule/github/requirements.yml
91+
fi
92+
7993
# Add prepare playbook if exists
8094
if test -f "molecule/default/prepare.yml"; then
8195
yq e --inplace '.provisioner.playbooks += {"prepare":"../default/prepare.yml"}' molecule/github/molecule.yml
@@ -92,8 +106,10 @@ jobs:
92106
run: pip3 install -r molecule/requirements.txt
93107

94108
- name: Install Ansible Role Requirements
95-
run: ansible-galaxy install -r requirements.yml
96-
continue-on-error: true
109+
run: |
110+
if test -f "requirements.yml"; then
111+
ansible-galaxy install -r requirements.yml
112+
fi
97113
98114
- name: Disable AppArmor (MySQL)
99115
run: |

0 commit comments

Comments
 (0)