Skip to content

Commit

Permalink
Cache choco packages to work around connectivity issues (#3536)
Browse files Browse the repository at this point in the history
* Cache choco packages to work around connectivity issues

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Download file as cache key if needed

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Skip choco if gather_dumps is false

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Skip choco if gather_dumps is false

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler1968@gmail.com>

---------

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
  • Loading branch information
3 people committed May 21, 2024
1 parent d00755c commit 130647e
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,42 @@ jobs:
with:
ref: ${{ github.event.workflow_run.head_branch }}

# Check if .github/workflows/reusable-test.yml exists locally.
- name: Check for .github/workflows/reusable-test.yml
# Check for test logs even if the workflow failed.
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6
if: (inputs.gather_dumps == true) && (steps.skip_check.outputs.should_skip != 'true')
id: check_reusable_test_locally
with:
files: .github/workflows/reusable-test.yml

# Check out just this file if code hasn't been checked out yet.
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
if: (steps.check_reusable_test_locally.outputs.files_exists != 'true') && (steps.skip_check.outputs.should_skip != 'true')
with:
sparse-checkout: |
.github/workflows/reusable-test.yml
sparse-checkout-cone-mode: false

- name: Set up choco cache folder
# Set the choco cache to a local folder so that it can be cached.
if: (inputs.gather_dumps == true) && (steps.skip_check.outputs.should_skip != 'true')
id: choco-cache
run: |
mkdir ${{github.workspace}}\choco_cache
choco config set --name cacheLocation --value ${{github.workspace}}\choco_cache
- name: Cache choco packages
# Add cache entry for any choco packages that are installed.
# The cache key is based on the hash of this file so if any choco packages are added or removed, the cache will be invalidated.
if: (inputs.gather_dumps == true) && (steps.skip_check.outputs.should_skip != 'true')
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
env:
cache-name: cache-choco-packages
with:
path: ${{github.workspace}}\choco_cache
key: ${{ hashFiles('.github/workflows/reusable-test.yml') }}

- name: Install ProcDump
id: install_procdump
if: (inputs.gather_dumps == true) && (steps.skip_check.outputs.should_skip != 'true')
Expand Down

0 comments on commit 130647e

Please sign in to comment.