Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 29c12dc

Browse filesBrowse files
committed
feat: install sccache on latest ubuntu arm
1 parent 8115710 commit 29c12dc
Copy full SHA for 29c12dc

File tree

Expand file treeCollapse file tree

6 files changed

+26
-13
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+26
-13
lines changed

‎dist/legacy/setup-cpp.js

Copy file name to clipboardExpand all lines: dist/legacy/setup-cpp.js
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/legacy/setup-cpp.js.map

Copy file name to clipboardExpand all lines: dist/legacy/setup-cpp.js.map
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/modern/setup-cpp.mjs

Copy file name to clipboardExpand all lines: dist/modern/setup-cpp.mjs
+1-1Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎dist/modern/setup-cpp.mjs.map

Copy file name to clipboardExpand all lines: dist/modern/setup-cpp.mjs.map
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/sccache/__tests__/sccache.test.ts

Copy file name to clipboardExpand all lines: src/sccache/__tests__/sccache.test.ts
+8-7Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1+
import { getUbuntuVersion } from "ubuntu-version"
2+
import { isUbuntu } from "../../utils/env/isUbuntu.js"
13
import type { InstallationInfo } from "../../utils/setup/setupBin.js"
24
import { testBin } from "../../utils/tests/test-helpers.js"
35
import { setupSccache } from "../sccache.js"
46

57
jest.setTimeout(300000)
68
describe("setup-sccache", () => {
7-
if (process.platform === "linux" && process.arch === "arm64") {
8-
it("should skip sccache tests on Linux arm64", () => {
9-
expect(true).toBe(true)
10-
})
11-
return
12-
}
13-
149
it("should setup sccache", async () => {
10+
const ubuntuVersion = isUbuntu() ? await getUbuntuVersion() : undefined
11+
const ubuntuVersionMajor = ubuntuVersion?.[0] ?? 0
12+
if (process.platform === "linux" && process.arch === "arm64" && ubuntuVersionMajor < 24) {
13+
return
14+
}
15+
1516
const installInfo = await setupSccache("", "", process.arch)
1617

1718
await testBin("sccache", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)

‎src/sccache/sccache.ts

Copy file name to clipboardExpand all lines: src/sccache/sccache.ts
+14-2Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1+
import { installAptPack } from "setup-apt"
12
import { installBrewPack } from "setup-brew"
3+
import { getUbuntuVersion } from "ubuntu-version"
4+
import { isUbuntu } from "../utils/env/isUbuntu.js"
25
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
36

47
// eslint-disable-next-line @typescript-eslint/no-unused-vars
5-
export function setupSccache(version: string, _setupDir: string, _arch: string) {
8+
export async function setupSccache(version: string, _setupDir: string, _arch: string) {
69
switch (process.platform) {
710
case "win32": {
811
return setupChocoPack("sccache", version)
912
}
10-
case "linux":
13+
case "linux": {
14+
if (isUbuntu()) {
15+
const ubuntuVersion = await getUbuntuVersion()
16+
if (ubuntuVersion[0] >= 24) {
17+
return installAptPack([{ name: "sccache", version }])
18+
}
19+
}
20+
21+
return installBrewPack("sccache", version)
22+
}
1123
case "darwin": {
1224
return installBrewPack("sccache", version)
1325
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.