Skip to content

Commit 592d162

Browse files
authored
Merge pull request #4312 from github/henrymercer/all-platform-bundle-checks
Make the "All-platform bundle" PR check use the all-platform bundle
2 parents fbfa9f3 + 4e3aa41 commit 592d162

5 files changed

Lines changed: 32 additions & 64 deletions

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ runs:
3636
set -e # Fail this Action if `gh release list` fails.
3737
3838
if [[ "$VERSION" == "nightly" || "$VERSION" == "nightly-latest" ]]; then
39-
echo "tools-url=nightly" >> "$GITHUB_OUTPUT"
39+
if [[ "$USE_ALL_PLATFORM_BUNDLE" == "true" ]]; then
40+
# With `tools: nightly`, the Action downloads the bundle for the runner's platform, so look
41+
# up the latest nightly release here to get its all-platform bundle instead.
42+
tag=$(gh release list --repo dsp-testing/codeql-cli-nightlies --limit 1 --json tagName --jq '.[0].tagName')
43+
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$tag/codeql-bundle.tar.gz" >> "$GITHUB_OUTPUT"
44+
else
45+
echo "tools-url=nightly" >> "$GITHUB_OUTPUT"
46+
fi
4047
exit 0
4148
elif [[ "$VERSION" == "linked" ]]; then
4249
echo "tools-url=linked" >> "$GITHUB_OUTPUT"

‎.github/workflows/__all-platform-bundle.yml‎

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

‎.github/workflows/deflake.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ on:
3131
- "PR Check - C/C\\+\\+: autoinstalling dependencies is skipped (macOS)"
3232
- "PR Check - C/C\\+\\+: disabling autoinstalling dependencies (Linux)"
3333
- "PR Check - Clean up database cluster directory"
34-
- "PR Check - CodeQL Bundle All"
3534
- "PR Check - Config export"
3635
- "PR Check - Config input"
3736
- "PR Check - Custom source root"

‎.github/workflows/test-codeql-bundle-all.yml‎

Lines changed: 0 additions & 62 deletions
This file was deleted.

‎pr-checks/checks/all-platform-bundle.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ steps:
1717
# Swift is not supported on Ubuntu so we manually exclude it from the list here
1818
languages: cpp,csharp,go,java,javascript,python,ruby
1919
tools: ${{ steps.prepare-test.outputs.tools-url }}
20+
- name: Check that the bundle contains tools for all platforms
21+
env:
22+
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
23+
run: |
24+
# Platform-specific bundles only contain the tools for their own platform.
25+
tools_dir="$(dirname "$CODEQL_PATH")/tools"
26+
for platform in linux64 osx64 win64; do
27+
if [[ ! -d "$tools_dir/$platform" ]]; then
28+
echo "::error::Expected an all-platform CodeQL bundle, but '$tools_dir' does not contain a '$platform' directory."
29+
exit 1
30+
fi
31+
done
2032
- name: Build code
2133
run: ./build.sh
2234
- uses: ./../action/analyze

0 commit comments

Comments
 (0)