@factorialco/gat
Advanced tools
Comparing version 0.0.3 to 0.0.4
import { Job, JobOptions } from "./job"; | ||
import type { Event, EventName, EventOptions } from "./event"; | ||
import { BaseStep, Step } from "./step"; | ||
declare const DEFAULT_RUNNERS: string[]; | ||
interface DefaultOptions { | ||
@@ -11,3 +12,3 @@ workingDirectory: string; | ||
} | ||
export declare class Workflow<JobStep extends BaseStep = Step, Runner = "ubuntu-22.04", JobName = never> { | ||
export declare class Workflow<JobStep extends BaseStep = Step, Runner = typeof DEFAULT_RUNNERS, JobName = never> { | ||
name: string; | ||
@@ -24,4 +25,5 @@ events: Event[]; | ||
defaultRunner(): string; | ||
private assignRunner; | ||
compile(): string; | ||
} | ||
export {}; |
@@ -9,2 +9,3 @@ "use strict"; | ||
const kebabCase_1 = __importDefault(require("lodash/kebabCase")); | ||
const DEFAULT_RUNNERS = ["ubuntu-22.04"]; | ||
class Workflow { | ||
@@ -37,2 +38,7 @@ constructor(name) { | ||
} | ||
assignRunner(runsOn) { | ||
const runnerName = runsOn ?? this.defaultRunner(); | ||
const isSelfHosted = !DEFAULT_RUNNERS.includes(runnerName); | ||
return isSelfHosted ? ["self-hosted", runnerName] : [runnerName]; | ||
} | ||
compile() { | ||
@@ -56,3 +62,3 @@ const result = { | ||
if: ifExpression, | ||
"runs-on": runsOn ?? this.defaultRunner(), | ||
"runs-on": this.assignRunner(runsOn), | ||
"timeout-minutes": timeout ?? 15, | ||
@@ -59,0 +65,0 @@ needs: dependsOn, |
@@ -150,3 +150,3 @@ "use strict"; | ||
workflow.on("push").addJob("job1", { | ||
runsOn: ["self-hosted", "standard-runner"], | ||
runsOn: "standard-runner", | ||
steps: [ | ||
@@ -153,0 +153,0 @@ { |
{ | ||
"name": "@factorialco/gat", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "TODO", | ||
@@ -5,0 +5,0 @@ "bin": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15381
407