Support rust analysis
This is supposed to enable rust analysis for the staff ship only.
This commit is contained in:
parent
d99c7e8e5b
commit
a7b17782a9
16 changed files with 186 additions and 13 deletions
23
lib/init-action.js
generated
23
lib/init-action.js
generated
|
|
@ -345,6 +345,29 @@ async function run() {
|
|||
logger.info(`Setting C++ build-mode: none to ${value}`);
|
||||
core.exportVariable(bmnVar, value);
|
||||
}
|
||||
// Set CODEQL_ENABLE_EXPERIMENTAL_FEATURES for rust
|
||||
if (config.languages.includes(languages_1.Language.rust)) {
|
||||
const feat = feature_flags_1.Feature.RustAnalysis;
|
||||
const minVer = feature_flags_1.featureConfig[feat].minimumVersion;
|
||||
if (!(await (0, util_1.codeQlVersionAtLeast)(codeql, minVer))) {
|
||||
logger.error(`Experimental rust analysis requires CodeQL version ${minVer} or higher`);
|
||||
}
|
||||
else {
|
||||
const envVar = feature_flags_1.featureConfig[feat].envVar;
|
||||
const expVar = "CODEQL_ENABLE_EXPERIMENTAL_FEATURES";
|
||||
if (process.env[envVar] === "true" ||
|
||||
(await features.getValue(feat, codeql))) {
|
||||
core.exportVariable(expVar, "true");
|
||||
}
|
||||
if (process.env[expVar] === "true") {
|
||||
logger.info("Experimental rust analysis enabled");
|
||||
}
|
||||
else {
|
||||
logger.error("Experimental rust analysis requested but not enabled. " +
|
||||
"You must set the CODEQL_ENABLE_EXPERIMENTAL_FEATURES environment variable to true");
|
||||
}
|
||||
}
|
||||
}
|
||||
// Restore dependency cache(s), if they exist.
|
||||
if ((0, caching_utils_1.shouldRestoreCache)(config.dependencyCachingEnabled)) {
|
||||
await (0, dependency_caching_1.downloadDependencyCaches)(config.languages, logger);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue