Skip to content

Commit afa442a

Browse files
Get cache keys
1 parent ae9546b commit afa442a

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/test_roles_pr.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ jobs:
9898
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
9999
run: echo "Latest Elasticsearch ${{ matrix.release }}.x = ${{ steps.elastic-version.outputs.version }}"
100100

101+
- name: Debug - list existing apt caches
102+
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
103+
env:
104+
GH_TOKEN: ${{ github.token }}
105+
run: |
106+
WANT_KEY="${{ runner.os }}-apt-elastic-${{ steps.elastic-version.outputs.version }}"
107+
echo "=== Looking for key: ${WANT_KEY} ==="
108+
echo "=== All caches with prefix '${{ runner.os }}-apt-elastic-${{ matrix.release }}.' ==="
109+
gh api "repos/${{ github.repository }}/actions/caches?key=${{ runner.os }}-apt-elastic-${{ matrix.release }}.&per_page=100" \
110+
| jq -r '.actions_caches[] | "\(.key) size=\(.size_in_bytes) created=\(.created_at)"'
111+
echo "=== Total cache count in repo ==="
112+
gh api "repos/${{ github.repository }}/actions/caches?per_page=1" | jq '.total_count'
113+
101114
- name: Restore Elastic apt cache
102115
id: apt-cache
103116
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
@@ -224,6 +237,19 @@ jobs:
224237
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
225238
run: echo "Latest Elasticsearch ${{ matrix.release }}.x = ${{ steps.elastic-version.outputs.version }}"
226239

240+
- name: Debug - list existing apt caches
241+
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')
242+
env:
243+
GH_TOKEN: ${{ github.token }}
244+
run: |
245+
WANT_KEY="${{ runner.os }}-apt-elastic-${{ steps.elastic-version.outputs.version }}"
246+
echo "=== Looking for key: ${WANT_KEY} ==="
247+
echo "=== All caches with prefix '${{ runner.os }}-apt-elastic-${{ matrix.release }}.' ==="
248+
gh api "repos/${{ github.repository }}/actions/caches?key=${{ runner.os }}-apt-elastic-${{ matrix.release }}.&per_page=100" \
249+
| jq -r '.actions_caches[] | "\(.key) size=\(.size_in_bytes) created=\(.created_at)"'
250+
echo "=== Total cache count in repo ==="
251+
gh api "repos/${{ github.repository }}/actions/caches?per_page=1" | jq '.total_count'
252+
227253
- name: Restore Elastic apt cache
228254
id: apt-cache
229255
if: contains(matrix.distro, 'ubuntu') || contains(matrix.distro, 'debian')

0 commit comments

Comments
 (0)