Skip to content

Commit feea86e

Browse files
authored
Merge pull request #1810 from github/henrymercer/ci/use-platform-specific-bundles
Use platform specific bundles in PR checks
2 parents de6681c + 679aac1 commit feea86e

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

.github/actions/prepare-test/action.yml

+18-6
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,27 @@ runs:
2323
shell: bash
2424
run: |
2525
set -e # Fail this Action if `gh release list` fails.
26+
27+
if [[ "$RUNNER_OS" == "Linux" ]]; then
28+
artifact_name="codeql-bundle-linux64.tar.gz"
29+
elif [[ "$RUNNER_OS" == "macOS" ]]; then
30+
artifact_name="codeql-bundle-osx64.tar.gz"
31+
elif [[ "$RUNNER_OS" == "Windows" ]]; then
32+
artifact_name="codeql-bundle-win64.tar.gz"
33+
else
34+
echo "::error::Unrecognized OS $RUNNER_OS"
35+
exit 1
36+
fi
37+
2638
if [[ ${{ inputs.version }} == "nightly-latest" ]]; then
27-
export LATEST=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
28-
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
39+
tag=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
40+
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$tag/$artifact_name" >> $GITHUB_OUTPUT
2941
elif [[ ${{ inputs.version }} == *"nightly"* ]]; then
30-
export VERSION=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
31-
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$VERSION-manual/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
42+
version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
43+
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$version-manual/$artifact_name" >> $GITHUB_OUTPUT
3244
elif [[ ${{ inputs.version }} == *"stable"* ]]; then
33-
export VERSION=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
34-
echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$VERSION/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
45+
version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
46+
echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT
3547
elif [[ ${{ inputs.version }} == "latest" ]]; then
3648
echo "tools-url=latest" >> $GITHUB_OUTPUT
3749
elif [[ ${{ inputs.version }} == "cached" ]]; then

.github/workflows/__test-local-codeql.yml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pr-checks/checks/test-local-codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ steps:
1212
- id: init
1313
uses: ./../action/init
1414
with:
15-
tools: ./codeql-bundle.tar.gz
15+
tools: ./codeql-bundle-linux64.tar.gz
1616
- uses: ./../action/.github/actions/setup-swift
1717
with:
1818
codeql-path: ${{ steps.init.outputs.codeql-path }}

0 commit comments

Comments
 (0)