Skip to content

Commit e0d373f

Browse files
ci: cache Ansible Galaxy roles (#27)
1 parent 59ff09b commit e0d373f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/actions/prepare-env-composite-action/action.yml renamed to .github/actions/prepare-env-composite-action/action.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ runs:
1616
run: |
1717
venv_dir=$(make print-venv-dir)
1818
collections_dir=$(make print-ansible-collections-dir)
19+
galaxy_roles_dir=$(make print-ansible-galaxy-roles-dir)
1920
python_reqs_file=$(make print-python-requirements-file)
2021
ansible_reqs_file=$(make print-ansible-requirements-file)
2122
2223
echo "venv_dir=$venv_dir" >> $GITHUB_OUTPUT
2324
echo "collections_dir=$collections_dir" >> $GITHUB_OUTPUT
25+
echo "galaxy_roles_dir=galaxy_roles_dir" >> $GITHUB_OUTPUT
2426
echo "python_reqs_file=$python_reqs_file" >> $GITHUB_OUTPUT
2527
echo "ansible_reqs_file=$ansible_reqs_file" >> $GITHUB_OUTPUT
2628
@@ -41,6 +43,12 @@ runs:
4143
key: collections-${{ runner.os }}-${{ steps.env_info.outputs.ansible_hash }}
4244
path: ${{ steps.env_info.outputs.collections_dir }}
4345

46+
- name: Cache Ansible Galaxy roles
47+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # SHA for version 4.2.4
48+
with:
49+
key: roles-${{ runner.os }}-${{ steps.env_info.outputs.ansible_hash }}
50+
path: ${{ steps.env_info.outputs.galaxy_roles_dir }}
51+
4452
- name: Install dependencies according to requirements files
4553
run: |
4654
touch ${{ steps.env_info.outputs.ansible_reqs_file }}

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ print-venv-dir:
154154
print-ansible-collections-dir:
155155
@echo $(ANSIBLE_COLLECTIONS_SUBDIR)
156156

157+
print-ansible-galaxy-roles-dir:
158+
@echo $(ANSIBLE_GALAXY_ROLES_SUBDIR)
159+
157160
print-python-requirements-file:
158161
@echo $(PYTHON_REQS_FILE)
159162

0 commit comments

Comments
 (0)