@kitsi/action 0.0.5 → 0.0.7
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/index.js +39 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -101774,7 +101774,8 @@ class KitBuilder {
|
|
|
101774
101774
|
const withEnv = Object.entries(this.config.env).reduce((t, [key, value]) => t.env(key, value), withImage);
|
|
101775
101775
|
return new TaskBuilder({
|
|
101776
101776
|
...withEnv.config,
|
|
101777
|
-
setupSteps: [...this.config.setupSteps]
|
|
101777
|
+
setupSteps: [...this.config.setupSteps],
|
|
101778
|
+
kitName: this.config.name
|
|
101778
101779
|
});
|
|
101779
101780
|
}
|
|
101780
101781
|
}
|
|
@@ -102413,13 +102414,42 @@ var normalizeOp = (op, ctx, analysis, tracker, resultValue) => {
|
|
|
102413
102414
|
return { kind: op.kind };
|
|
102414
102415
|
}
|
|
102415
102416
|
};
|
|
102417
|
+
var placeholderForOp2 = (op, tracker) => {
|
|
102418
|
+
const isPrimary = tracker.value !== undefined;
|
|
102419
|
+
switch (op.kind) {
|
|
102420
|
+
case "command": {
|
|
102421
|
+
if (!isPrimary)
|
|
102422
|
+
return;
|
|
102423
|
+
const commandOp = op;
|
|
102424
|
+
if (commandOp.capture === "ok")
|
|
102425
|
+
return true;
|
|
102426
|
+
if (commandOp.capture === "code")
|
|
102427
|
+
return 0;
|
|
102428
|
+
return "";
|
|
102429
|
+
}
|
|
102430
|
+
case "use":
|
|
102431
|
+
return isPrimary ? op.ref.parse("") : undefined;
|
|
102432
|
+
case "emit":
|
|
102433
|
+
return op.value;
|
|
102434
|
+
case "pack":
|
|
102435
|
+
case "unpack":
|
|
102436
|
+
return;
|
|
102437
|
+
case "env": {
|
|
102438
|
+
const envOp = op;
|
|
102439
|
+
return typeof envOp.value === "string" || typeof envOp.value === "number" ? envOp.value : isPrimary ? "" : undefined;
|
|
102440
|
+
}
|
|
102441
|
+
default:
|
|
102442
|
+
return tracker.value;
|
|
102443
|
+
}
|
|
102444
|
+
};
|
|
102416
102445
|
var analyzeGenerator = (iterator, ctx, analysis, tracker, resultValue) => {
|
|
102417
102446
|
const ops = [];
|
|
102418
102447
|
let cursor = iterator.next();
|
|
102419
102448
|
while (!cursor.done) {
|
|
102420
102449
|
const op = toOp2(cursor.value);
|
|
102421
102450
|
ops.push(normalizeOp(op, ctx, analysis, tracker, resultValue));
|
|
102422
|
-
|
|
102451
|
+
const placeholder = placeholderForOp2(op, tracker);
|
|
102452
|
+
cursor = iterator.next(placeholder);
|
|
102423
102453
|
}
|
|
102424
102454
|
return ops;
|
|
102425
102455
|
};
|
|
@@ -103952,6 +103982,7 @@ class PlanRunner {
|
|
|
103952
103982
|
signal;
|
|
103953
103983
|
states = new Map;
|
|
103954
103984
|
inProgress = new Set;
|
|
103985
|
+
completedKitSetups = new Set;
|
|
103955
103986
|
resolver;
|
|
103956
103987
|
commandRunner;
|
|
103957
103988
|
opHandlers;
|
|
@@ -104096,11 +104127,16 @@ class PlanRunner {
|
|
|
104096
104127
|
});
|
|
104097
104128
|
return this.toResult(state, undefined, cacheHit);
|
|
104098
104129
|
}
|
|
104099
|
-
const
|
|
104130
|
+
const kitName = task2.config.kitName;
|
|
104131
|
+
const skipSetup = kitName ? this.completedKitSetups.has(kitName) : false;
|
|
104132
|
+
const steps = skipSetup ? task2.config.steps : [...task2.config.setupSteps, ...task2.config.steps];
|
|
104100
104133
|
for (const step2 of steps) {
|
|
104101
104134
|
this.checkSignal("task");
|
|
104102
104135
|
await this.executeStep(task2, step2, env2, state);
|
|
104103
104136
|
}
|
|
104137
|
+
if (kitName && !skipSetup && task2.config.setupSteps.length > 0) {
|
|
104138
|
+
this.completedKitSetups.add(kitName);
|
|
104139
|
+
}
|
|
104104
104140
|
await this.flushArtifactUploads(task2, env2, state, "success");
|
|
104105
104141
|
await this.cache.afterTask(task2, state, cacheDecision);
|
|
104106
104142
|
state.status = "success";
|