Skip to content

Commit efea9cc

Browse files
committed
Add installYq option to sync.py and cache downloads
1 parent 55252c7 commit efea9cc

File tree

3 files changed

+35
-10
lines changed

3 files changed

+35
-10
lines changed

.github/workflows/__build-mode-autobuild.yml

Lines changed: 12 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pr-checks/checks/build-mode-autobuild.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ description: "An end-to-end integration test of a Java repository built using 'b
33
operatingSystems: ["ubuntu", "windows"]
44
versions: ["linked", "nightly-latest"]
55
installJava: "true"
6+
installYq: "true"
67
steps:
78
- name: Set up Java test repo configuration
89
run: |
@@ -18,11 +19,6 @@ steps:
1819
languages: java
1920
tools: ${{ steps.prepare-test.outputs.tools-url }}
2021

21-
- name: Install yq
22-
if: runner.os == 'Windows'
23-
run: |
24-
choco install yq -y
25-
2622
- name: Validate database build mode
2723
run: |
2824
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"

pr-checks/sync.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,28 @@ def writeHeader(checkStream):
223223
}
224224
})
225225

226+
installYq = is_truthy(checkSpecification.get('installYq', ''))
227+
228+
if installYq:
229+
steps.append({
230+
'name': "Restore choco cache",
231+
'if': "runner.os == 'Windows'",
232+
'uses': 'actions/cache@v5',
233+
'with': {
234+
'key': 'windows-choco-cache',
235+
'path': '${{ runner.temp }}/windows-choco-cache'
236+
}
237+
})
238+
steps.append({
239+
'name': 'Install yq',
240+
'if': "runner.os == 'Windows'",
241+
'shell': 'pwsh',
242+
'env': {
243+
'CACHE_DIR': '${{ runner.temp }}/windows-choco-cache'
244+
},
245+
'run': 'choco install yq -y --stoponfirstfailure --cache-location=${env:CACHE_DIR}',
246+
})
247+
226248
# If container initialisation steps are present in the check specification,
227249
# make sure to execute them first.
228250
if 'container' in checkSpecification and 'container-init-steps' in checkSpecification:

0 commit comments

Comments
 (0)