fix
All checks were successful
Check Transpiled JavaScript / Check dist/ (push) Successful in 1m1s
Continuous Integration / TypeScript Tests (push) Successful in 1m9s
Continuous Integration / GitHub Actions Test (push) Successful in 7m55s

This commit is contained in:
2024-11-17 12:29:45 +13:00
parent 159a17c5c7
commit 1b84eb59f6
4 changed files with 47 additions and 9 deletions

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="116" height="20" role="img" aria-label="Coverage: 17.74%"><title>Coverage: 17.74%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="116" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="63" height="20" fill="#555"/><rect x="63" width="53" height="20" fill="#e05d44"/><rect width="116" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="325" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="530">Coverage</text><text x="325" y="140" transform="scale(.1)" fill="#fff" textLength="530">Coverage</text><text aria-hidden="true" x="885" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">17.74%</text><text x="885" y="140" transform="scale(.1)" fill="#fff" textLength="430">17.74%</text></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="116" height="20" role="img" aria-label="Coverage: 17.64%"><title>Coverage: 17.64%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="116" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="63" height="20" fill="#555"/><rect x="63" width="53" height="20" fill="#e05d44"/><rect width="116" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="325" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="530">Coverage</text><text x="325" y="140" transform="scale(.1)" fill="#fff" textLength="530">Coverage</text><text aria-hidden="true" x="885" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">17.64%</text><text x="885" y="140" transform="scale(.1)" fill="#fff" textLength="430">17.64%</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

21
dist/index.js generated vendored
View File

@@ -28291,6 +28291,7 @@ exports.getLatestVersion = getLatestVersion;
const tc = __importStar(__nccwpck_require__(3472));
const core = __importStar(__nccwpck_require__(7484));
const httpm = __importStar(__nccwpck_require__(4844));
const exec = __importStar(__nccwpck_require__(5236));
/**
* Download a specific version of the Clang.
* @param version The version to download
@@ -28315,8 +28316,24 @@ async function download(version) {
core.info(`Downloading Clang ${version} (${process.platform}, ${process.arch}) from ${url} ...`);
const archivePath = await tc.downloadTool(url);
core.info(`Extracting Clang archive...`);
const extractedPath = await tc.extractTar(archivePath, undefined, '-x --strip-components=1');
const cachedPath = await tc.cacheDir(extractedPath, 'clang', version);
let exit = await exec.exec('mkdir', ['-p', `/tmp/clang-${version}`]);
if (exit !== 0) {
throw new Error(`Failed to create directory /tmp/clang-${version}`);
}
exit = await exec.exec('tar', [
'-x',
'--strip-components=1',
'--warning=no-unknown-keyword',
'--overwrite',
'-C',
`/tmp/clang-${version}`,
'-f',
archivePath
]);
if (exit !== 0) {
throw new Error(`Failed to extract clang`);
}
const cachedPath = await tc.cacheDir(`/tmp/clang-${version}`, 'clang', version);
return cachedPath;
}
async function getLatestVersion() {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,7 @@
import * as tc from '@actions/tool-cache'
import * as core from '@actions/core'
import * as httpm from '@actions/http-client'
import * as exec from '@actions/exec'
import { GitHubRelease } from './github-release'
/**
@@ -39,12 +40,32 @@ export async function download(version: string): Promise<string> {
core.info(`Extracting Clang archive...`)
const extractedPath = await tc.extractTar(
archivePath,
undefined,
'-x --strip-components=1'
let exit = await exec.exec('mkdir', ['-p', `/tmp/clang-${version}`])
if (exit !== 0) {
throw new Error(`Failed to create directory /tmp/clang-${version}`)
}
exit = await exec.exec('tar', [
'-x',
'--strip-components=1',
'--warning=no-unknown-keyword',
'--overwrite',
'-C',
`/tmp/clang-${version}`,
'-f',
archivePath
])
if (exit !== 0) {
throw new Error(`Failed to extract clang`)
}
const cachedPath = await tc.cacheDir(
`/tmp/clang-${version}`,
'clang',
version
)
const cachedPath = await tc.cacheDir(extractedPath, 'clang', version)
return cachedPath
}