Skip to content

Commit

Permalink
support Ubuntu arm64 runners with sccache variant (#280)
Browse files Browse the repository at this point in the history
Enable the sccache variant of ccache-action to run on GitHub Ubuntu arm64 runners.
  • Loading branch information
andrurogerz authored Jan 22, 2025
1 parent 5391144 commit 433beb5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
shell: [bash]
variant: [sccache, ccache]
include:
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
shell: [bash]
variant: [sccache, ccache]
include:
Expand All @@ -123,7 +123,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
shell: [bash]
variant: [sccache, ccache]
include:
Expand All @@ -150,7 +150,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
shell: [bash]
variant: [sccache, ccache]
include:
Expand Down
16 changes: 15 additions & 1 deletion dist/restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68150,7 +68150,21 @@ async function installSccacheMac() {
await execShell("brew install sccache");
}
async function installSccacheLinux() {
await installSccacheFromGitHub("v0.7.6", "x86_64-unknown-linux-musl", "8c2bb0805983a6fe334fa8b5c26db2c5fc3a7fc3dbf51522a08f2e4c50e4fbe7", "/usr/local/bin/", "sccache");
let packageName;
let sha256;
switch (external_process_namespaceObject.arch) {
case "x64":
packageName = "x86_64-unknown-linux-musl";
sha256 = "8c2bb0805983a6fe334fa8b5c26db2c5fc3a7fc3dbf51522a08f2e4c50e4fbe7";
break;
case "arm64":
packageName = "aarch64-unknown-linux-musl";
sha256 = "d4773c9a6716b70ecdf646c1ee018e1b5be71bed0af5c3d82e5c595833744dbf";
break;
default:
throw new Error(`Unsupported architecture: ${external_process_namespaceObject.arch}`);
}
await installSccacheFromGitHub("v0.7.6", packageName, sha256, "/usr/local/bin/", "sccache");
}
async function installSccacheWindows() {
await installSccacheFromGitHub("v0.7.6", "x86_64-pc-windows-msvc", "48e88be2ba87dca8d74364f045894ec214b6c850e65e61ab44e5071055c9e6d3",
Expand Down
18 changes: 16 additions & 2 deletions src/restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,24 @@ async function installSccacheMac() : Promise<void> {
}

async function installSccacheLinux() : Promise<void> {
let packageName: string;
let sha256: string;
switch (process.arch) {
case "x64":
packageName = "x86_64-unknown-linux-musl";
sha256 = "8c2bb0805983a6fe334fa8b5c26db2c5fc3a7fc3dbf51522a08f2e4c50e4fbe7";
break;
case "arm64":
packageName = "aarch64-unknown-linux-musl";
sha256 = "d4773c9a6716b70ecdf646c1ee018e1b5be71bed0af5c3d82e5c595833744dbf";
break;
default:
throw new Error(`Unsupported architecture: ${process.arch}`);
}
await installSccacheFromGitHub(
"v0.7.6",
"x86_64-unknown-linux-musl",
"8c2bb0805983a6fe334fa8b5c26db2c5fc3a7fc3dbf51522a08f2e4c50e4fbe7",
packageName,
sha256,
"/usr/local/bin/",
"sccache"
);
Expand Down

0 comments on commit 433beb5

Please sign in to comment.