Skip to content

Commit 3641624

Browse files
committed
Reorganize Ansible set up in validate_pr workflow
Signed-off-by: Webster Mudge <[email protected]>
1 parent a99e9c5 commit 3641624

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

.github/workflows/validate_pr.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,55 +24,58 @@ on:
2424

2525
jobs:
2626
validate:
27-
name: Install and validate collection
27+
name: Validate collection
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: Checkout repository
3131
uses: actions/checkout@v4
3232

33-
- name: Setup Python and caching
34-
uses: actions/setup-python@v4
33+
- name: Set up Python and caching
34+
uses: actions/setup-python@v5
3535
with:
3636
python-version: "3.12"
3737
cache: "pip"
3838

39-
- name: Install Hatch
40-
run: |
41-
python -m pip install hatch
39+
# - name: Install Hatch
40+
# run: |
41+
# python -m pip install hatch
4242

4343
- name: Set up Ansible and Ansible collections and roles
4444
run: |
4545
sudo update-alternatives --install /usr/bin/python python $(which python3) 1
4646
pip install --upgrade pip
47-
pip install ansible-core~=2.18.0 ansible-builder bindep pycodestyle voluptuous pylint pyyaml ansible-lint
47+
pip install ansible-core<2.17 ansible-builder bindep pycodestyle voluptuous pylint pyyaml ansible-lint
48+
49+
- name: Install Ansible collections and roles
50+
run: |
4851
mkdir -p /usr/share/ansible/collections /usr/share/ansible/roles
4952
ansible-galaxy collection install -r builder/requirements.yml -p /usr/share/ansible/collections
5053
ansible-galaxy role install -r builder/requirements.yml -p /usr/share/ansible/roles
5154
52-
- name: Report Ansible version, collections, and roles
53-
run: |
54-
ansible --version
55-
ansible-galaxy collection list
56-
ansible-galaxy role list
57-
5855
- name: Set up Ansible collection dependencies
5956
run: |
6057
ansible-builder introspect --write-pip final_python.txt --write-bindep final_bindep.txt /usr/share/ansible/collections
6158
[[ -f final_python.txt ]] && pip install -r final_python.txt || echo "No Python dependencies found."
6259
[[ -f final_bindep.txt ]] && bindep --file final_bindep.txt || echo "No system dependencies found."
6360
61+
- name: Report Ansible version, collections, and roles
62+
run: |
63+
ansible --version
64+
ansible-galaxy collection list
65+
ansible-galaxy role list
66+
6467
- name: Report installed Python dependencies
6568
run: pip freeze
6669

6770
- name: Validate collection
6871
run: |
6972
# pushd /usr/share/ansible/collections/ansible_collections/cloudera/cluster
7073
# hatch run lint
71-
ansible-lint --no-offline
72-
#ansible-test sanity --test pep8
73-
#ansible-test sanity --test validate-modules
74-
#ansible-test units --requirements --color yes --redact
75-
popd
74+
# ansible-lint --no-offline. # --no-offline is ignored!
75+
# ansible-test sanity --test pep8
76+
# ansible-test sanity --test validate-modules
77+
# ansible-test units --requirements --color yes --redact
78+
# popd
7679
7780
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
7881
- name: Save PR number
@@ -89,8 +92,8 @@ jobs:
8992
path: pr/
9093

9194
import-galaxy:
95+
name: Validate Galaxy import
9296
needs: validate
9397
permissions:
9498
contents: read
95-
name: Import collection with Galaxy importer
9699
uses: ansible-community/github-action-test-galaxy-import/.github/workflows/test-galaxy-import.yml@main

0 commit comments

Comments
 (0)