mirror of
https://github.com/github/codeql-action.git
synced 2026-04-26 00:38:48 +00:00
Add installYq option to sync.py and cache downloads
This commit is contained in:
+12
-5
@@ -76,6 +76,18 @@ jobs:
|
||||
with:
|
||||
java-version: ${{ inputs.java-version || '17' }}
|
||||
distribution: temurin
|
||||
- name: Restore choco cache
|
||||
if: runner.os == 'Windows'
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
key: windows-choco-cache
|
||||
path: ${{ runner.temp }}/windows-choco-cache
|
||||
- name: Install yq
|
||||
if: runner.os == 'Windows'
|
||||
shell: pwsh
|
||||
env:
|
||||
CACHE_DIR: ${{ runner.temp }}/windows-choco-cache
|
||||
run: choco install yq -y --stoponfirstfailure --cache-location=${env:CACHE_DIR}
|
||||
- name: Set up Java test repo configuration
|
||||
run: |
|
||||
mv * .github ../action/tests/multi-language-repo/
|
||||
@@ -90,11 +102,6 @@ jobs:
|
||||
languages: java
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
|
||||
- name: Install yq
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
choco install yq -y
|
||||
|
||||
- name: Validate database build mode
|
||||
run: |
|
||||
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
|
||||
|
||||
@@ -3,6 +3,7 @@ description: "An end-to-end integration test of a Java repository built using 'b
|
||||
operatingSystems: ["ubuntu", "windows"]
|
||||
versions: ["linked", "nightly-latest"]
|
||||
installJava: "true"
|
||||
installYq: "true"
|
||||
steps:
|
||||
- name: Set up Java test repo configuration
|
||||
run: |
|
||||
@@ -18,11 +19,6 @@ steps:
|
||||
languages: java
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
|
||||
- name: Install yq
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
choco install yq -y
|
||||
|
||||
- name: Validate database build mode
|
||||
run: |
|
||||
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
|
||||
|
||||
@@ -223,6 +223,28 @@ for file in sorted((this_dir / 'checks').glob('*.yml')):
|
||||
}
|
||||
})
|
||||
|
||||
installYq = is_truthy(checkSpecification.get('installYq', ''))
|
||||
|
||||
if installYq:
|
||||
steps.append({
|
||||
'name': "Restore choco cache",
|
||||
'if': "runner.os == 'Windows'",
|
||||
'uses': 'actions/cache@v5',
|
||||
'with': {
|
||||
'key': 'windows-choco-cache',
|
||||
'path': '${{ runner.temp }}/windows-choco-cache'
|
||||
}
|
||||
})
|
||||
steps.append({
|
||||
'name': 'Install yq',
|
||||
'if': "runner.os == 'Windows'",
|
||||
'shell': 'pwsh',
|
||||
'env': {
|
||||
'CACHE_DIR': '${{ runner.temp }}/windows-choco-cache'
|
||||
},
|
||||
'run': 'choco install yq -y --stoponfirstfailure --cache-location=${env:CACHE_DIR}',
|
||||
})
|
||||
|
||||
# If container initialisation steps are present in the check specification,
|
||||
# make sure to execute them first.
|
||||
if 'container' in checkSpecification and 'container-init-steps' in checkSpecification:
|
||||
|
||||
Reference in New Issue
Block a user