@factorialco/gat 3.5.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/job.d.ts CHANGED
@@ -8,6 +8,7 @@ export interface Matrix {
8
8
  options: Array<string | number | boolean>;
9
9
  }>;
10
10
  extra?: Array<Record<string, string | number | boolean>>;
11
+ maxParallel?: number;
11
12
  }
12
13
  export interface Service {
13
14
  image: string;
package/dist/workflow.js CHANGED
@@ -107,6 +107,9 @@ class Workflow {
107
107
  strategy: matrix
108
108
  ? {
109
109
  "fail-fast": false,
110
+ "max-parallel": typeof matrix !== "string" && matrix.maxParallel != null
111
+ ? matrix.maxParallel
112
+ : undefined,
110
113
  matrix: typeof matrix === "string"
111
114
  ? matrix
112
115
  : {
@@ -126,6 +126,26 @@ const workflow_1 = require("./workflow");
126
126
  });
127
127
  (0, vitest_1.expect)(await workflow.compile()).toMatchSnapshot();
128
128
  });
129
+ (0, vitest_1.it)("allows a job matrix with max-parallel", async () => {
130
+ const workflow = new workflow_1.Workflow("Matrix with max parallel");
131
+ workflow.on("push").addJob("job1", {
132
+ matrix: {
133
+ elements: [
134
+ {
135
+ id: "food",
136
+ options: ["🍕", "🍔", "🌮"],
137
+ },
138
+ ],
139
+ maxParallel: 2,
140
+ },
141
+ steps: [
142
+ {
143
+ run: "echo ${{ matrix.food }}",
144
+ },
145
+ ],
146
+ });
147
+ (0, vitest_1.expect)(await workflow.compile()).toMatchSnapshot();
148
+ });
129
149
  (0, vitest_1.it)("allows uses steps", async () => {
130
150
  const workflow = new workflow_1.Workflow("Uses steps");
131
151
  workflow
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorialco/gat",
3
- "version": "3.5.0",
3
+ "version": "3.8.0",
4
4
  "description": "Write your GitHub Actions workflows using TypeScript",
5
5
  "bin": {
6
6
  "gat": "dist/cli.js"