Class JobStrategy.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.github.workflows.JobStrategy.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<JobStrategy>
- Enclosing interface:
- JobStrategy
@Stability(Experimental) public static final class JobStrategy.Builder extends Object implements software.amazon.jsii.Builder<JobStrategy>
A builder forJobStrategy
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JobStrategybuild()Builds the configured instance.JobStrategy.BuilderfailFast(Boolean failFast)Sets the value ofJobStrategy.getFailFast()JobStrategy.Buildermatrix(JobMatrix matrix)Sets the value ofJobStrategy.getMatrix()JobStrategy.BuildermaxParallel(Number maxParallel)Sets the value ofJobStrategy.getMaxParallel()
-
-
-
Method Detail
-
failFast
@Stability(Experimental) public JobStrategy.Builder failFast(Boolean failFast)
Sets the value ofJobStrategy.getFailFast()- Parameters:
failFast- When set to true, GitHub cancels all in-progress jobs if any matrix job fails. Default: true- Returns:
this
-
matrix
@Stability(Experimental) public JobStrategy.Builder matrix(JobMatrix matrix)
Sets the value ofJobStrategy.getMatrix()- Parameters:
matrix- You can define a matrix of different job configurations. A matrix allows you to create multiple jobs by performing variable substitution in a single job definition. For example, you can use a matrix to create jobs for more than one supported version of a programming language, operating system, or tool. A matrix reuses the job's configuration and creates a job for each matrix you configure.A job matrix can generate a maximum of 256 jobs per workflow run. This limit also applies to self-hosted runners.
- Returns:
this
-
maxParallel
@Stability(Experimental) public JobStrategy.Builder maxParallel(Number maxParallel)
Sets the value ofJobStrategy.getMaxParallel()- Parameters:
maxParallel- The maximum number of jobs that can run simultaneously when using a matrix job strategy. By default, GitHub will maximize the number of jobs run in parallel depending on the available runners on GitHub-hosted virtual machines.- Returns:
this
-
build
@Stability(Experimental) public JobStrategy build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<JobStrategy>- Returns:
- a new instance of
JobStrategy - Throws:
NullPointerException- if any required attribute was not provided
-
-