act-test-runner 2.0.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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/dist/ActExecStatus.d.ts +28 -0
  4. package/dist/ActExecStatus.js +29 -0
  5. package/dist/ActJobExecResult.d.ts +39 -0
  6. package/dist/ActJobExecResult.js +42 -0
  7. package/dist/ActOutputListener.d.ts +58 -0
  8. package/dist/ActOutputListener.js +45 -0
  9. package/dist/ActResourceSpec.d.ts +6 -0
  10. package/dist/ActRunner.d.ts +168 -0
  11. package/dist/ActRunner.js +304 -0
  12. package/dist/ActRunnerError.d.ts +25 -0
  13. package/dist/ActRunnerError.js +25 -0
  14. package/dist/ActRunnerOptions.d.ts +57 -0
  15. package/dist/ActRunnerOptions.js +22 -0
  16. package/dist/ActRunnerResult.d.ts +68 -0
  17. package/dist/ActRunnerResult.js +33 -0
  18. package/dist/ActWorkflowExecResult.d.ts +45 -0
  19. package/dist/ActWorkflowExecResult.js +49 -0
  20. package/dist/index.d.ts +27 -0
  21. package/dist/index.js +24 -0
  22. package/dist/internal/ActCliParams.d.ts +57 -0
  23. package/dist/internal/ActCliParams.js +119 -0
  24. package/dist/internal/ActExecListener.d.ts +37 -0
  25. package/dist/internal/ActExecListener.js +98 -0
  26. package/dist/internal/ActJobExecResultBuilder.d.ts +33 -0
  27. package/dist/internal/ActJobExecResultBuilder.js +52 -0
  28. package/dist/internal/ActJobOutputProcessor.d.ts +40 -0
  29. package/dist/internal/ActJobOutputProcessor.js +101 -0
  30. package/dist/internal/ActJsonOutput.d.ts +39 -0
  31. package/dist/internal/ActJsonOutput.js +53 -0
  32. package/dist/internal/ActResourceSpec.d.ts +26 -0
  33. package/dist/internal/ActResourceSpec.js +30 -0
  34. package/dist/internal/ActStepOutputProcessor.d.ts +32 -0
  35. package/dist/internal/ActStepOutputProcessor.js +51 -0
  36. package/dist/internal/JobIterationTracker.d.ts +27 -0
  37. package/dist/internal/JobIterationTracker.js +41 -0
  38. package/dist/internal/JobTrackingActExecListener.d.ts +34 -0
  39. package/dist/internal/JobTrackingActExecListener.js +74 -0
  40. package/dist/internal/OutputForwardingActExecListener.d.ts +30 -0
  41. package/dist/internal/OutputForwardingActExecListener.js +40 -0
  42. package/dist/utils/checks.d.ts +23 -0
  43. package/dist/utils/checks.js +38 -0
  44. package/dist/utils/fsutils.d.ts +27 -0
  45. package/dist/utils/fsutils.js +43 -0
  46. package/dist/utils/objects.d.ts +22 -0
  47. package/dist/utils/objects.js +25 -0
  48. package/dist/utils/types.d.ts +24 -0
  49. package/dist/utils/types.js +22 -0
  50. package/package.json +72 -0
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2025 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ export declare class ActResourceSpec {
22
+ readonly path: string;
23
+ readonly host: string | undefined;
24
+ readonly port: number | undefined;
25
+ constructor(path: string, host: string | undefined, port: number | undefined);
26
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (c) 2025 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ export class ActResourceSpec {
22
+ path;
23
+ host;
24
+ port;
25
+ constructor(path, host, port) {
26
+ this.path = path;
27
+ this.host = host;
28
+ this.port = port;
29
+ }
30
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright (c) 2026 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ import type { ActStepExecResult } from '../ActRunnerResult.js';
23
+ import { ActJobOrStepDescriptor } from '../ActOutputListener.js';
24
+ import { JsonOutput } from './ActJsonOutput.js';
25
+ export declare class ActStepExecResultBuilder {
26
+ readonly descriptor: ActJobOrStepDescriptor;
27
+ private status;
28
+ private readonly outputLines;
29
+ constructor(descriptor: ActJobOrStepDescriptor);
30
+ processOutput(output: JsonOutput): void;
31
+ buildResult(): ActStepExecResult;
32
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Copyright (c) 2026 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ import { ActExecStatus } from '../ActRunnerResult.js';
23
+ import { formattedMessage } from './ActJsonOutput.js';
24
+ export class ActStepExecResultBuilder {
25
+ descriptor;
26
+ status;
27
+ outputLines = [];
28
+ constructor(descriptor) {
29
+ this.descriptor = descriptor;
30
+ }
31
+ processOutput(output) {
32
+ const msg = formattedMessage(output.msg, output.job);
33
+ this.outputLines.push(msg);
34
+ if (output.stepResult === 'failure') {
35
+ this.status = ActExecStatus.FAILED;
36
+ }
37
+ else if (output.stepResult === 'skipped') {
38
+ this.status = ActExecStatus.SKIPPED;
39
+ }
40
+ else if (output.stepResult !== undefined) {
41
+ this.status = ActExecStatus.SUCCESS;
42
+ }
43
+ }
44
+ buildResult() {
45
+ return {
46
+ name: this.descriptor.name,
47
+ status: this.status,
48
+ output: this.outputLines.join('\n'),
49
+ };
50
+ }
51
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright (c) 2026 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ import { ActMatrixValues } from '../ActRunnerResult.js';
23
+ export declare class JobIterationTracker {
24
+ private readonly matrixIdx;
25
+ private matrixKey;
26
+ iterationIndex(matrix: ActMatrixValues): number;
27
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Copyright (c) 2026 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ export class JobIterationTracker {
23
+ matrixIdx = new Map();
24
+ matrixKey(matrix) {
25
+ return Object.entries(matrix)
26
+ .map((value) => `${value[0]}\u0000${value[1]}`)
27
+ .sort((a, b) => (a > b ? 1 : -1))
28
+ .reduce((prev, curr) => `${prev}\u0000${curr}`);
29
+ }
30
+ iterationIndex(matrix) {
31
+ const key = this.matrixKey(matrix);
32
+ if (this.matrixIdx.has(key)) {
33
+ return this.matrixIdx.get(key);
34
+ }
35
+ else {
36
+ const newIterationIndex = this.matrixIdx.size + 1;
37
+ this.matrixIdx.set(key, newIterationIndex);
38
+ return newIterationIndex;
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Copyright (c) 2025 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ import { ActJobExecResult } from '../ActJobExecResult.js';
22
+ import type { ActExecListener } from './ActExecListener.js';
23
+ export declare class JobTrackingActExecListener implements ActExecListener {
24
+ private readonly execOutput;
25
+ private readonly jobsByName;
26
+ onStdOutput(output: string): void;
27
+ onStdError(output: string): void;
28
+ private onStdOutputOrError;
29
+ private maybeProcessJobOutput;
30
+ private extractJobName;
31
+ getOutput(): string;
32
+ getJobs(): Map<String, ActJobExecResult>;
33
+ private createOrGetBuilder;
34
+ }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Copyright (c) 2025 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ import { ActJobExecResultBuilder } from './ActJobExecResultBuilder.js';
22
+ export class JobTrackingActExecListener {
23
+ execOutput = [];
24
+ jobsByName = new Map();
25
+ onStdOutput(output) {
26
+ this.onStdOutputOrError(output);
27
+ }
28
+ onStdError(output) {
29
+ this.onStdOutputOrError(output);
30
+ }
31
+ onStdOutputOrError(output) {
32
+ const lines = output.toString().split('\n');
33
+ lines.forEach((line) => {
34
+ this.execOutput.push(line);
35
+ this.maybeProcessJobOutput(line);
36
+ });
37
+ }
38
+ maybeProcessJobOutput(line) {
39
+ if (line.startsWith('[')) {
40
+ const jobName = this.extractJobName(line);
41
+ const jobBuilder = this.createOrGetBuilder(jobName);
42
+ jobBuilder.output(line);
43
+ if (line.includes('Success - Main')) {
44
+ jobBuilder.stepCompleted();
45
+ }
46
+ else if (line.endsWith('Job succeeded')) {
47
+ jobBuilder.completed();
48
+ }
49
+ else if (line.endsWith('Job failed')) {
50
+ jobBuilder.failed();
51
+ }
52
+ }
53
+ }
54
+ extractJobName(line) {
55
+ const prefixSeparator = line.indexOf('/');
56
+ const prefixEnd = line.indexOf(']');
57
+ return line.substring(prefixSeparator + 1, prefixEnd).trim();
58
+ }
59
+ getOutput() {
60
+ return this.execOutput.join('\n');
61
+ }
62
+ getJobs() {
63
+ return new Map(Array.from(this.jobsByName).map(([name, jobBuilder]) => [
64
+ name,
65
+ jobBuilder.build(),
66
+ ]));
67
+ }
68
+ createOrGetBuilder(jobName) {
69
+ if (!this.jobsByName.has(jobName)) {
70
+ this.jobsByName.set(jobName, new ActJobExecResultBuilder(jobName));
71
+ }
72
+ return this.jobsByName.get(jobName);
73
+ }
74
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (c) 2025 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ import type { ActExecListener } from './ActExecListener.js';
22
+ import type { ActJobExecResult } from '../ActJobExecResult.js';
23
+ export declare class OutputForwardingActExecListener implements ActExecListener {
24
+ private readonly delegate;
25
+ constructor(delegate: ActExecListener);
26
+ onStdOutput(output: string): void;
27
+ onStdError(output: string): void;
28
+ getOutput(): string;
29
+ getJobs(): Map<String, ActJobExecResult>;
30
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright (c) 2025 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ export class OutputForwardingActExecListener {
22
+ delegate;
23
+ constructor(delegate) {
24
+ this.delegate = delegate;
25
+ }
26
+ onStdOutput(output) {
27
+ console.log(output);
28
+ this.delegate.onStdOutput(output);
29
+ }
30
+ onStdError(output) {
31
+ console.error(output);
32
+ this.delegate.onStdError(output);
33
+ }
34
+ getOutput() {
35
+ return this.delegate.getOutput();
36
+ }
37
+ getJobs() {
38
+ return this.delegate.getJobs();
39
+ }
40
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2026 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ export declare function checkOneDefined<T>(first: T | undefined, second: T | undefined): void;
23
+ export declare function checkExists(label: string, path?: string): string;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Copyright (c) 2026 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ import { existsSync } from 'node:fs';
23
+ import { ActRunnerError } from '../ActRunnerResult.js';
24
+ export function checkOneDefined(first, second) {
25
+ if ((first === undefined && second === undefined) ||
26
+ (first !== undefined && second !== undefined)) {
27
+ throw new ActRunnerError(`Expected one value out of '${first}' and '${second}' to be defined`);
28
+ }
29
+ }
30
+ export function checkExists(label, path) {
31
+ if (!path) {
32
+ throw new ActRunnerError(`The specified ${label} is undefined`);
33
+ }
34
+ if (!existsSync(path)) {
35
+ throw new ActRunnerError(`The specified ${label} '${path}' does not exist`);
36
+ }
37
+ return path;
38
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright (c) 2026 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ import { WebhookEvent } from '@octokit/webhooks-types';
23
+ import { PartialDeep } from './types.js';
24
+ export declare function createTempWorkflowFile(workingDir: string, workflowBody: string): string;
25
+ export declare function createTempEventPayloadFile(workingDir: string, eventPayloadBody: PartialDeep<WebhookEvent>): string;
26
+ export declare function cleanupDir(workingDir: string): void;
27
+ export declare function createTempDir(): string;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Copyright (c) 2026 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ import { existsSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
23
+ import { tmpdir } from 'node:os';
24
+ import { join } from 'node:path';
25
+ export function createTempWorkflowFile(workingDir, workflowBody) {
26
+ const fileName = join(workingDir, 'workflow.yml');
27
+ writeFileSync(fileName, workflowBody);
28
+ return fileName;
29
+ }
30
+ export function createTempEventPayloadFile(workingDir, eventPayloadBody) {
31
+ const fileName = join(workingDir, 'event.json');
32
+ writeFileSync(fileName, JSON.stringify(eventPayloadBody));
33
+ return fileName;
34
+ }
35
+ export function cleanupDir(workingDir) {
36
+ if (existsSync(workingDir)) {
37
+ rmSync(workingDir, { recursive: true, force: true });
38
+ }
39
+ }
40
+ export function createTempDir() {
41
+ const prefix = join(tmpdir(), 'act-test-runner');
42
+ return mkdtempSync(prefix);
43
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) 2026 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ export declare function firstDefined<T>(first: () => T | undefined, second: () => T): T;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) 2026 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ export function firstDefined(first, second) {
23
+ const firstValue = first();
24
+ return firstValue !== undefined ? firstValue : second();
25
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) 2026 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ export type PartialDeep<T> = T extends object ? {
23
+ [P in keyof T]?: PartialDeep<T[P]>;
24
+ } : T;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) 2026 original authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ export {};