mirror of
https://github.com/github/codeql-action.git
synced 2026-11-05 04:29:40 +00:00
Rename isSwiftCompatible
This commit is contained in:
4
lib/entry-points.js
generated
4
lib/entry-points.js
generated
@@ -186046,7 +186046,7 @@ async function getToolsInput(action, repositoryProperties) {
|
||||
}
|
||||
|
||||
// src/languages/swift.ts
|
||||
function isSwiftCompatible(action, config) {
|
||||
function checkSwiftCompatibility(action, config) {
|
||||
if (config.languages.includes("swift" /* swift */) && action.platform !== "darwin") {
|
||||
throw new ConfigurationError(
|
||||
`Swift analysis is only supported on macOS runner images. Please migrate to a macOS runner.`
|
||||
@@ -186573,7 +186573,7 @@ async function run3(actionState) {
|
||||
enableFileCoverageInformation: fileCoverageResult.enabled,
|
||||
logger: logger2
|
||||
});
|
||||
isSwiftCompatible(actionState, config);
|
||||
checkSwiftCompatibility(actionState, config);
|
||||
if (repositoryPropertiesResult.isFailure()) {
|
||||
addNoLanguageDiagnostic(
|
||||
config,
|
||||
|
||||
@@ -62,7 +62,7 @@ import {
|
||||
runDatabaseInitCluster,
|
||||
} from "./init";
|
||||
import { JavaEnvVars, BuiltInLanguage } from "./languages";
|
||||
import { isSwiftCompatible } from "./languages/swift";
|
||||
import { checkSwiftCompatibility } from "./languages/swift";
|
||||
import { Logger, withGroupAsync } from "./logging";
|
||||
import {
|
||||
downloadOverlayBaseDatabaseFromCache,
|
||||
@@ -419,7 +419,7 @@ async function run(
|
||||
logger,
|
||||
});
|
||||
|
||||
isSwiftCompatible(actionState, config);
|
||||
checkSwiftCompatibility(actionState, config);
|
||||
|
||||
if (repositoryPropertiesResult.isFailure()) {
|
||||
addNoLanguageDiagnostic(
|
||||
|
||||
@@ -12,18 +12,18 @@ import {
|
||||
} from "../testing-utils";
|
||||
import { withTmpDir } from "../util";
|
||||
|
||||
import { isSwiftCompatible } from "./swift";
|
||||
import { checkSwiftCompatibility } from "./swift";
|
||||
|
||||
import { BuiltInLanguage } from ".";
|
||||
|
||||
test("isSwiftCompatible doesn't throw for non-Swift languages", (t) => {
|
||||
test("checkSwiftCompatibility doesn't throw for non-Swift languages", (t) => {
|
||||
for (const language of Object.values(BuiltInLanguage)) {
|
||||
if (language === BuiltInLanguage.swift) {
|
||||
continue;
|
||||
}
|
||||
|
||||
t.notThrows(() =>
|
||||
isSwiftCompatible(
|
||||
checkSwiftCompatibility(
|
||||
initAllState(),
|
||||
createTestConfig({ languages: [language] }),
|
||||
),
|
||||
@@ -31,7 +31,7 @@ test("isSwiftCompatible doesn't throw for non-Swift languages", (t) => {
|
||||
}
|
||||
});
|
||||
|
||||
test("isSwiftCompatible doesn't throw for Swift on darwin", async (t) =>
|
||||
test("checkSwiftCompatibility doesn't throw for Swift on darwin", async (t) =>
|
||||
withTmpDir(async (tmpDir) => {
|
||||
const logger = new RecordingLogger();
|
||||
const env = getTestEnv();
|
||||
@@ -41,7 +41,7 @@ test("isSwiftCompatible doesn't throw for Swift on darwin", async (t) =>
|
||||
sinon.stub(codeql, "getVersion").resolves(makeVersionInfo("2.27.0"));
|
||||
|
||||
t.notThrows(() =>
|
||||
isSwiftCompatible(
|
||||
checkSwiftCompatibility(
|
||||
initAllState({ platform: "darwin", env, logger }),
|
||||
createTestConfig({
|
||||
tempDir: tmpDir,
|
||||
@@ -53,9 +53,9 @@ test("isSwiftCompatible doesn't throw for Swift on darwin", async (t) =>
|
||||
|
||||
const nonDarwinPlatforms: NodeJS.Platform[] = ["linux", "win32"];
|
||||
for (const nonDarwinPlatform of nonDarwinPlatforms) {
|
||||
test(`isSwiftCompatible throws for Swift on ${nonDarwinPlatform}`, (t) => {
|
||||
test(`checkSwiftCompatibility throws for Swift on ${nonDarwinPlatform}`, (t) => {
|
||||
t.throws(() => {
|
||||
isSwiftCompatible(
|
||||
checkSwiftCompatibility(
|
||||
initAllState({ platform: nonDarwinPlatform }),
|
||||
createTestConfig({ languages: [BuiltInLanguage.swift] }),
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ import { BuiltInLanguage } from ".";
|
||||
* @throws {ConfigurationError} If Swift analysis is not possible on the current runner.
|
||||
* @returns True if we can run a Swift analysis.
|
||||
*/
|
||||
export function isSwiftCompatible(
|
||||
export function checkSwiftCompatibility(
|
||||
action: ActionState<["Base"]>,
|
||||
config: Config,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user