Skip to content
Merged
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
90 changes: 90 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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor: "download" -> "downloads" to make the tense consistent


## 4.37.9 - 26 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.

30 changes: 30 additions & 0 deletions pr-checks/checks/linux-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor and doesn't have to be addressed in this PR, but it might be good to analyse all languages that we support on arm64 (ignore if that's already what this list is)

tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build Go code
run: go build main.go
- uses: ./../action/analyze
with:
upload-database: false
Comment thread
redsun82 marked this conversation as resolved.
- name: Assert databases exist
run: |
cd "$RUNNER_TEMP/codeql_databases"
for lang in javascript python go; do

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor: It would be nice if the list of languages wasn't duplicated between the init input and here.

if [[ ! -d "$lang" ]]; then
echo "Did not find a database for $lang"
exit 1
fi
done
39 changes: 26 additions & 13 deletions 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 Expand Up @@ -157,20 +156,34 @@ for (const [platform, arch] of [
);
}

test("wrapCliConfigurationError - supported platform", (t) => {
const commandError = new CommandInvocationError(
"codeql",
["version"],
1,
"Some error",
);
const cliError = new CliError(commandError);
for (const [platform, arch] of [
["linux", "x64"],
["linux", "arm64"],
["win32", "x64"],
["darwin", "x64"],
["darwin", "arm64"],
]) {
test.serial(
`wrapCliConfigurationError - ${platform}/${arch} supported`,
(t) => {
sinon.stub(process, "platform").value(platform);
sinon.stub(process, "arch").value(arch);
const commandError = new CommandInvocationError(
"codeql",
["version"],
1,
"Some error",
);
const cliError = new CliError(commandError);

const wrappedError = wrapCliConfigurationError(cliError);
const wrappedError = wrapCliConfigurationError(cliError);

// Should return the original error since platform is supported
t.is(wrappedError, cliError);
});
// Should return the original error since the platform is supported, rather
// than replacing it with the unsupported-platform ConfigurationError.
t.is(wrappedError, cliError);
},
);
}

test("wrapCliConfigurationError - autobuild error", (t) => {
const commandError = new CommandInvocationError(
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"],
Comment thread
redsun82 marked this conversation as resolved.
["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 thread
redsun82 marked this conversation as resolved.
{
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 @@ -937,7 +937,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