Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/workflows/__linux-arm64.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th

## [UNRELEASED]

No user facing changes.
- The CodeQL Action now supports CodeQL releases that are compatible with Linux Arm64 and download the native `linux-arm64` CodeQL bundle when available. [#4072](https://github.com/github/codeql-action/pull/4072)

## 4.37.5 - 03 Aug 2026

Expand Down
3 changes: 2 additions & 1 deletion lib/entry-points.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions pr-checks/checks/linux-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Linux Arm64"
description: "An end-to-end integration test running on a Linux Arm64 runner, checking that the native linux-arm64 CodeQL bundle is downloaded and can analyze interpreted and compiled code"
operatingSystems:
- os: ubuntu
runner-image: ubuntu-24.04-arm
# The native linux-arm64 CodeQL bundle is only available in recent CLI releases, so we restrict this
# check to `nightly-latest`, which is guaranteed to ship it. Older stable versions do not have an
# arm64 asset, and `prepare-test` would resolve an x64 bundle URL for them on this runner.
versions:
- nightly-latest
installGo: true
steps:
- uses: ./../action/init
with:
languages: javascript,python,go
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build Go code
run: go build main.go
- uses: ./../action/analyze
with:
skip-queries: true
upload-database: false
- name: Assert databases exist
run: |
cd "$RUNNER_TEMP/codeql_databases"
for lang in javascript python go; do
if [[ ! -d "$lang" ]]; then
echo "Did not find a database for $lang"
exit 1
fi
done
1 change: 0 additions & 1 deletion src/cli-errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ test("CliError constructor with empty stderr", (t) => {

for (const [platform, arch] of [
["weird_plat", "x64"],
["linux", "arm64"],
["win32", "arm64"],
]) {
test.serial(
Expand Down
1 change: 1 addition & 0 deletions src/cli-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ConfigurationError } from "./util";

const SUPPORTED_PLATFORMS = [
["linux", "x64"],
["linux", "arm64"],
["win32", "x64"],
["darwin", "x64"],
["darwin", "arm64"],
Expand Down
22 changes: 21 additions & 1 deletion src/setup-codeql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,42 @@ test.serial(
const LINKED_BUNDLE_TEST_CASES = [
{
platform: "linux",
arch: "x64",
tarSupportsZstd: true,
expectedBundleName: "codeql-bundle-linux64.tar.zst",
expectedCompressionMethod: "zstd",
},
{
platform: "linux",
arch: "arm64",
tarSupportsZstd: true,
expectedBundleName: "codeql-bundle-linux-arm64.tar.zst",
expectedCompressionMethod: "zstd",
},
{
platform: "darwin",
arch: "arm64",
tarSupportsZstd: true,
expectedBundleName: "codeql-bundle-osx64.tar.zst",
expectedCompressionMethod: "zstd",
},
Comment on lines 135 to 141

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test for darwin x64?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, will do!

{
platform: "darwin",
arch: "x64",
tarSupportsZstd: true,
expectedBundleName: "codeql-bundle-osx64.tar.zst",
expectedCompressionMethod: "zstd",
},
{
platform: "win32",
arch: "x64",
tarSupportsZstd: true,
expectedBundleName: "codeql-bundle-win64.tar.gz",
expectedCompressionMethod: "gzip",
},
{
platform: "linux",
arch: "x64",
tarSupportsZstd: false,
expectedBundleName: "codeql-bundle-linux64.tar.gz",
expectedCompressionMethod: "gzip",
Expand All @@ -146,15 +164,17 @@ const LINKED_BUNDLE_TEST_CASES = [

for (const {
platform,
arch,
tarSupportsZstd,
expectedBundleName,
expectedCompressionMethod,
} of LINKED_BUNDLE_TEST_CASES) {
test.serial(
`getCodeQLSource selects ${expectedBundleName} for linked tools`,
`getCodeQLSource selects ${expectedBundleName} for linked tools on ${platform}/${arch}`,
async (t) => {
const features = createFeatures([]);
sinon.stub(process, "platform").value(platform);
sinon.stub(process, "arch").value(arch);

await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
Expand Down
2 changes: 1 addition & 1 deletion src/setup-codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function getCodeQLBundleName(
if (process.platform === "win32") {
platform = "win64";
} else if (process.platform === "linux") {
platform = "linux64";
platform = process.arch === "arm64" ? "linux-arm64" : "linux64";
} else if (process.platform === "darwin") {
platform = "osx64";
} else {
Expand Down
4 changes: 3 additions & 1 deletion src/testing-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,9 @@ export function mockBundleDownloadApi({
process.platform === "win32"
? "win64"
: process.platform === "linux"
? "linux64"
? process.arch === "arm64"
? "linux-arm64"
: "linux64"
: "osx64";

const baseUrl = apiDetails?.url ?? "https://example.com";
Expand Down
Loading