Skip to content

Commit 3d3d4e6

Browse files
committed
Add caching to GHA
1 parent 5d3fb44 commit 3d3d4e6

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎.github/workflows/plugin_test.yaml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ jobs:
3838
update-environment: false
3939
- name: Check out code
4040
uses: actions/checkout@v5
41+
- name: Determine Please version
42+
if: ${{ inputs.platform != 'freebsd_amd64' }}
43+
id: please_version
44+
run: echo "version=$(./pleasew --version | awk '{print $NF}')" >> "$GITHUB_OUTPUT"
45+
- name: Cache Please downloads
46+
# The FreeBSD tests run inside a nested VM, so the host's cache directory isn't visible to them.
47+
if: ${{ inputs.platform != 'freebsd_amd64' }}
48+
uses: actions/cache@v4
49+
with:
50+
path: ~/.cache/please
51+
key: please-${{ inputs.platform }}-${{ steps.please_version.outputs.version }}-${{ hashFiles('plugins/BUILD', 'third_party/**/BUILD') }}
52+
restore-keys: |
53+
please-${{ inputs.platform }}-${{ steps.please_version.outputs.version }}-
54+
please-${{ inputs.platform }}-
4155
- name: Configure plugin to use please_pex tool built from source
4256
if: inputs.please_pex_from_repo
4357
# PexTool can't be set to //tools/please_pex for e2e tests because it can't be built inside the e2e test

0 commit comments

Comments
 (0)