fix: fix llvm 15 on ubuntu - add logging for extraction

This commit is contained in:
Amin Yahyaabadi 2022-12-06 21:56:16 -08:00
parent 0e9ce85be9
commit bd369094f9
6 changed files with 39 additions and 38 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
import { find, downloadTool, cacheDir } from "@actions/tool-cache" import { find, downloadTool, cacheDir } from "@actions/tool-cache"
import { info } from "@actions/core"
import { addPath } from "../env/addEnv" import { addPath } from "../env/addEnv"
import { join } from "patha" import { join } from "patha"
import { info } from "ci-log"
import { tmpdir } from "os" import { tmpdir } from "os"
import ciDetect from "@npmcli/ci-detect" import ciDetect from "@npmcli/ci-detect"
@ -89,29 +89,30 @@ export async function setupBin(
// download ane extract the package into the installation directory. // download ane extract the package into the installation directory.
if ((await Promise.all([pathExists(binDir), pathExists(binFile)])).includes(false)) { if ((await Promise.all([pathExists(binDir), pathExists(binFile)])).includes(false)) {
info(`Download and extract ${name} ${version}`)
if (!didInit) {
if (process.platform === "linux") {
// extraction dependencies
if (isArch()) {
setupPacmanPack("unzip")
setupPacmanPack("tar")
setupPacmanPack("xz")
} else if (hasDnf()) {
setupDnfPack("unzip")
setupDnfPack("tar")
setupDnfPack("xz")
} else if (isUbuntu()) {
await setupAptPack([{ name: "unzip" }, { name: "tar" }, { name: "xz-utils" }])
}
}
// eslint-disable-next-line require-atomic-updates
didInit = true
}
try { try {
info(`Download ${name} ${version}`)
const downloaded = await downloadTool(url) const downloaded = await downloadTool(url)
if (!didInit) {
info(`Installing extraction dependencies`)
if (process.platform === "linux") {
if (isArch()) {
setupPacmanPack("unzip")
setupPacmanPack("tar")
setupPacmanPack("xz")
} else if (hasDnf()) {
setupDnfPack("unzip")
setupDnfPack("tar")
setupDnfPack("xz")
} else if (isUbuntu()) {
await setupAptPack([{ name: "unzip" }, { name: "tar" }, { name: "xz-utils" }])
}
}
// eslint-disable-next-line require-atomic-updates
didInit = true
}
info(`Extracting ${downloaded} to ${setupDir}`)
await extractFunction?.(downloaded, setupDir) await extractFunction?.(downloaded, setupDir)
// if (typeof extractedBinDir === "string") { // if (typeof extractedBinDir === "string") {
// binDir = extractedBinDir // binDir = extractedBinDir

View File

@ -30,24 +30,24 @@ export const DefaultLinuxVersion: Record<string, Record<number, string>> = {
14: "11", 14: "11",
}, },
llvm: { llvm: {
22: "15.0.6-ubuntu-18.0.4", 22: "15.0.6-ubuntu-18.04",
20: "15.0.6-ubuntu-18.0.4", 20: "15.0.6-ubuntu-18.04",
18: "15.0.6-ubuntu-18.0.4", 18: "15.0.6-ubuntu-18.04",
16: "15.0.6-ubuntu-18.0.4", 16: "15.0.6-ubuntu-18.04",
14: "13.0.0-ubuntu-16.04", 14: "13.0.0-ubuntu-16.04",
}, },
clangtidy: { clangtidy: {
22: "15.0.6-ubuntu-18.0.4", 22: "15.0.6-ubuntu-18.04",
20: "15.0.6-ubuntu-18.0.4", 20: "15.0.6-ubuntu-18.04",
18: "15.0.6-ubuntu-18.0.4", 18: "15.0.6-ubuntu-18.04",
16: "15.0.6-ubuntu-18.0.4", 16: "15.0.6-ubuntu-18.04",
14: "13.0.0-ubuntu-16.04", 14: "13.0.0-ubuntu-16.04",
}, },
clangformat: { clangformat: {
22: "15.0.6-ubuntu-18.0.4", 22: "15.0.6-ubuntu-18.04",
20: "15.0.6-ubuntu-18.0.4", 20: "15.0.6-ubuntu-18.04",
18: "15.0.6-ubuntu-18.0.4", 18: "15.0.6-ubuntu-18.04",
16: "15.0.6-ubuntu-18.0.4", 16: "15.0.6-ubuntu-18.04",
14: "13.0.0-ubuntu-16.04", 14: "13.0.0-ubuntu-16.04",
}, },
gcovr: { gcovr: {