apify-test-tools 0.1.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 (103) hide show
  1. package/README.md +23 -0
  2. package/bin/build.ts +287 -0
  3. package/bin/consts.ts +6 -0
  4. package/bin/git.ts +56 -0
  5. package/bin/github.ts +75 -0
  6. package/bin/main.ts +145 -0
  7. package/bin/slack.ts +72 -0
  8. package/bin/test-report.ts +146 -0
  9. package/bin/types.ts +102 -0
  10. package/bin/utils.ts +204 -0
  11. package/dist/bin/build.d.ts +18 -0
  12. package/dist/bin/build.d.ts.map +1 -0
  13. package/dist/bin/build.js +222 -0
  14. package/dist/bin/build.js.map +1 -0
  15. package/dist/bin/consts.d.ts +4 -0
  16. package/dist/bin/consts.d.ts.map +1 -0
  17. package/dist/bin/consts.js +6 -0
  18. package/dist/bin/consts.js.map +1 -0
  19. package/dist/bin/git.d.ts +7 -0
  20. package/dist/bin/git.d.ts.map +1 -0
  21. package/dist/bin/git.js +47 -0
  22. package/dist/bin/git.js.map +1 -0
  23. package/dist/bin/github.d.ts +12 -0
  24. package/dist/bin/github.d.ts.map +1 -0
  25. package/dist/bin/github.js +64 -0
  26. package/dist/bin/github.js.map +1 -0
  27. package/dist/bin/main.d.ts +3 -0
  28. package/dist/bin/main.d.ts.map +1 -0
  29. package/dist/bin/main.js +117 -0
  30. package/dist/bin/main.js.map +1 -0
  31. package/dist/bin/slack.d.ts +12 -0
  32. package/dist/bin/slack.d.ts.map +1 -0
  33. package/dist/bin/slack.js +46 -0
  34. package/dist/bin/slack.js.map +1 -0
  35. package/dist/bin/test-report.d.ts +10 -0
  36. package/dist/bin/test-report.d.ts.map +1 -0
  37. package/dist/bin/test-report.js +74 -0
  38. package/dist/bin/test-report.js.map +1 -0
  39. package/dist/bin/types.d.ts +88 -0
  40. package/dist/bin/types.d.ts.map +1 -0
  41. package/dist/bin/types.js +2 -0
  42. package/dist/bin/types.js.map +1 -0
  43. package/dist/bin/utils.d.ts +26 -0
  44. package/dist/bin/utils.d.ts.map +1 -0
  45. package/dist/bin/utils.js +164 -0
  46. package/dist/bin/utils.js.map +1 -0
  47. package/dist/index.d.ts +3 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +3 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/lib/consts.d.ts +3 -0
  52. package/dist/lib/consts.d.ts.map +1 -0
  53. package/dist/lib/consts.js +14 -0
  54. package/dist/lib/consts.js.map +1 -0
  55. package/dist/lib/extend-expect.d.ts +3 -0
  56. package/dist/lib/extend-expect.d.ts.map +1 -0
  57. package/dist/lib/extend-expect.js +228 -0
  58. package/dist/lib/extend-expect.js.map +1 -0
  59. package/dist/lib/lib.d.ts +16 -0
  60. package/dist/lib/lib.d.ts.map +1 -0
  61. package/dist/lib/lib.js +91 -0
  62. package/dist/lib/lib.js.map +1 -0
  63. package/dist/lib/run-test-result.d.ts +20 -0
  64. package/dist/lib/run-test-result.d.ts.map +1 -0
  65. package/dist/lib/run-test-result.js +62 -0
  66. package/dist/lib/run-test-result.js.map +1 -0
  67. package/dist/lib/types.d.ts +107 -0
  68. package/dist/lib/types.d.ts.map +1 -0
  69. package/dist/lib/types.js +2 -0
  70. package/dist/lib/types.js.map +1 -0
  71. package/dist/lib/utils.d.ts +7 -0
  72. package/dist/lib/utils.d.ts.map +1 -0
  73. package/dist/lib/utils.js +30 -0
  74. package/dist/lib/utils.js.map +1 -0
  75. package/dist/test/unit/custom-matchers.test.d.ts +2 -0
  76. package/dist/test/unit/custom-matchers.test.d.ts.map +1 -0
  77. package/dist/test/unit/custom-matchers.test.js +53 -0
  78. package/dist/test/unit/custom-matchers.test.js.map +1 -0
  79. package/dist/test/unit/should-built-and-test.test.d.ts +2 -0
  80. package/dist/test/unit/should-built-and-test.test.d.ts.map +1 -0
  81. package/dist/test/unit/should-built-and-test.test.js +136 -0
  82. package/dist/test/unit/should-built-and-test.test.js.map +1 -0
  83. package/dist/test/unit/test-actor.test.d.ts +2 -0
  84. package/dist/test/unit/test-actor.test.d.ts.map +1 -0
  85. package/dist/test/unit/test-actor.test.js +17 -0
  86. package/dist/test/unit/test-actor.test.js.map +1 -0
  87. package/dist/tsconfig.tsbuildinfo +1 -0
  88. package/example-github-events/pull-request.json +523 -0
  89. package/example-github-events/push.json +216 -0
  90. package/index.ts +2 -0
  91. package/lib/consts.ts +15 -0
  92. package/lib/extend-expect.ts +268 -0
  93. package/lib/lib.ts +134 -0
  94. package/lib/run-test-result.ts +70 -0
  95. package/lib/types.ts +131 -0
  96. package/lib/utils.ts +49 -0
  97. package/package.json +41 -0
  98. package/scripts/hook-job-started.sh +11 -0
  99. package/test/tsconfig.json +15 -0
  100. package/test/unit/custom-matchers.test.ts +61 -0
  101. package/test/unit/should-built-and-test.test.ts +166 -0
  102. package/test/unit/test-actor.test.ts +17 -0
  103. package/tsconfig.json +20 -0
@@ -0,0 +1,146 @@
1
+ import fs from 'fs/promises';
2
+ import { sendSlackMessage } from './slack.js';
3
+ import { getEnvVar } from './utils.js';
4
+
5
+ interface ReportTestRestulsOptions {
6
+ reportFile: string
7
+ dryRun: boolean
8
+ jobUrl?: string
9
+ repository?: string
10
+ workflowName?: string
11
+ }
12
+
13
+ export const reportTestRestuls = async ({
14
+ dryRun,
15
+ reportFile: jsonResultsPath,
16
+ jobUrl,
17
+ workflowName,
18
+ repository,
19
+ }: ReportTestRestulsOptions) => {
20
+ const results: JsonTestResults = JSON.parse((await fs.readFile(jsonResultsPath)).toString());
21
+ const passed: JsonAssertionResult[] = [];
22
+ const failed: JsonAssertionResult[] = [];
23
+
24
+ for (const result of results.testResults) {
25
+ if (result.status !== 'failed') {
26
+ passed.push(...result.assertionResults);
27
+ continue;
28
+ }
29
+ for (const aResult of result.assertionResults) {
30
+ if (aResult.status !== 'failed') {
31
+ passed.push(aResult);
32
+ } else {
33
+ failed.push(aResult);
34
+ }
35
+ }
36
+ }
37
+
38
+ const failedAssertions: string[] = [];
39
+
40
+ console.error();
41
+ console.error(`PASSED: ${passed.length}, FAILED: ${failed.length}`);
42
+ console.error();
43
+ console.error('**************************************************');
44
+ console.error('* Successes *');
45
+ console.error('**************************************************');
46
+ console.error();
47
+ for (const [i, aResult] of passed.entries()) {
48
+ const { fullName } = aResult;
49
+ console.error(`${i + 1}) ${fullName} ... ${aResult.meta.runLink}`);
50
+ console.error();
51
+ }
52
+
53
+ console.error('**************************************************');
54
+ console.error('* Failures *');
55
+ console.error('**************************************************');
56
+ console.error();
57
+ for (const [i, aResult] of failed.entries()) {
58
+ const { failureMessages, fullName } = aResult;
59
+ if (failureMessages) {
60
+ failedAssertions.push(...failureMessages.map(message => message.split('\n')?.[0]));
61
+ }
62
+ console.error(`${i + 1}) ${fullName} ... ${aResult.meta.runLink}`);
63
+ console.error();
64
+ }
65
+ console.error();
66
+ console.error(`PASSED: ${passed.length}, FAILED: ${failed.length}`);
67
+ console.error();
68
+
69
+ if (failedAssertions.length === 0) {
70
+ return;
71
+ }
72
+
73
+ // TODO: add slack profiles
74
+ const total = failed.length + passed.length;
75
+ const jobLink = jobUrl ? ` Check <${jobUrl}|the job>.` : '';
76
+ let slackMessage = `\`${workflowName ?? '-'}\`: *${repository ?? '-'}*`;
77
+ slackMessage += `: has ${failedAssertions.length} failed assertions. Failing test suites: ${failed.length}/${total}.${jobLink}`;
78
+ slackMessage += `\n\n${failedAssertions[0]}`;
79
+ const blocks = failedAssertions.slice(1);
80
+
81
+ if (!repository) {
82
+ console.error(`Repository not provided, not sending slack notification`);
83
+ return
84
+ }
85
+
86
+ // remove repository-owner part
87
+ const channel = `#notif-${repository.replace(/[^/]+\//, '')}`;
88
+ console.error(`Sending a notification to slack channel ${channel}`);
89
+ console.error('SLACK:', slackMessage);
90
+ console.error(' blocks:', blocks.join('\n'));
91
+ if (!dryRun) {
92
+ const slackToken = getEnvVar('SLACK_TOKEN_TESTS_BOT');
93
+ await sendSlackMessage(channel, slackMessage, blocks, slackToken);
94
+ }
95
+ };
96
+
97
+ type Status = 'passed' | 'failed' | 'skipped' | 'pending' | 'todo' | 'disabled'
98
+ type Milliseconds = number
99
+ interface Callsite {
100
+ line: number
101
+ column: number
102
+ }
103
+
104
+ interface JsonAssertionResult {
105
+ ancestorTitles: Array<string>
106
+ fullName: string
107
+ status: Status
108
+ title: string
109
+ meta: {
110
+ runId: string
111
+ runLink: string
112
+ }
113
+ duration?: Milliseconds | null
114
+ failureMessages: Array<string> | null
115
+ location?: Callsite | null
116
+ }
117
+
118
+ interface JsonTestResult {
119
+ message: string
120
+ name: string
121
+ status: 'failed' | 'passed'
122
+ startTime: number
123
+ endTime: number
124
+ assertionResults: Array<JsonAssertionResult>
125
+ // summary: string
126
+ // coverage: unknown
127
+ }
128
+
129
+ interface JsonTestResults {
130
+ numFailedTests: number
131
+ numFailedTestSuites: number
132
+ numPassedTests: number
133
+ numPassedTestSuites: number
134
+ numPendingTests: number
135
+ numPendingTestSuites: number
136
+ numTodoTests: number
137
+ numTotalTests: number
138
+ numTotalTestSuites: number
139
+ startTime: number
140
+ success: boolean
141
+ testResults: Array<JsonTestResult>
142
+ // snapshot: SnapshotSummary
143
+ // coverageMap?: CoverageMap | null | undefined
144
+ // numRuntimeErrorTestSuites: number
145
+ // wasInterrupted: boolean
146
+ }
package/bin/types.ts ADDED
@@ -0,0 +1,102 @@
1
+ export interface Config {
2
+ targetBranch: string
3
+ sourceBranch: string
4
+ baseCommit?: string
5
+ }
6
+
7
+ export type Commit = {
8
+ sha: string
9
+ author: string
10
+ date: string
11
+ message: string
12
+ }
13
+
14
+ // NOTE: The GitHub types are incomplete, feel free to add fields/complete (not sure how stable GitHub API is)
15
+ export interface GitHubHeadCommit {
16
+ added: string[]
17
+ removed: string[]
18
+ modified: string[],
19
+ author: {
20
+ name: string
21
+ },
22
+ message: string,
23
+ id: string,
24
+ }
25
+
26
+ export interface Repository {
27
+ full_name: string
28
+ name: string
29
+ ssh_url: string
30
+ owner: {
31
+ login: string
32
+ }
33
+ }
34
+
35
+ export type GitHubEvent = GitHubEventPullRequest | GitHubEventPush;
36
+
37
+ // All optional type so we check that we have all required fields for each event type
38
+ export type RawGitHubEvent = Partial<Omit<GitHubEventPullRequest, 'type'> & Omit<GitHubEventPush, 'type'>>;
39
+
40
+ export interface GitHubEventPullRequest {
41
+ // Type is our own variable we inject to have discriminated union
42
+ // The rest of the properties are raw from GitHub API
43
+ type: 'pull_request',
44
+ pull_request: {
45
+ number: number
46
+ base: {
47
+ ref: string,
48
+ sha: string
49
+ }
50
+ head: {
51
+ ref: string
52
+ sha: string
53
+ }
54
+ }
55
+ repository: Repository,
56
+ }
57
+
58
+ export interface GitHubEventPush {
59
+ type: 'push',
60
+ head_commit: GitHubHeadCommit,
61
+ repository: Repository,
62
+ ref: string
63
+ commits: GithubCommit[]
64
+ before: string
65
+ after: string
66
+ }
67
+
68
+ export interface GithubCommit {
69
+ id: string
70
+ tree_id: string
71
+ distinct: boolean
72
+ message: string
73
+ timestamp: string
74
+ url: string
75
+ author: {
76
+ name: string
77
+ email: string
78
+ username: string
79
+ }
80
+ committer: {
81
+ name: string
82
+ email: string
83
+ username: string
84
+ }
85
+ added: string[]
86
+ removed: string[]
87
+ modified: string[]
88
+ }
89
+
90
+ export interface BuildData {
91
+ buildId: string;
92
+ actorId: string;
93
+ actorName: string;
94
+ // folder: string | undefined;
95
+ buildNumber: string;
96
+ }
97
+
98
+ export interface ActorConfig {
99
+ actorName: string;
100
+ folder: string;
101
+ isStandalone: boolean
102
+ }
package/bin/utils.ts ADDED
@@ -0,0 +1,204 @@
1
+ import fs from 'node:fs/promises';
2
+ import { spawnSync } from 'node:child_process';
3
+ import type {
4
+ ActorConfig,
5
+ GitHubEvent,
6
+ } from './types.js';
7
+
8
+ export const spawnCommandInGhWorkspace = (command: string, args: string[] = []) => {
9
+ console.error(command, args.join(' '));
10
+ const ghWorkspace = getEnvVar('GITHUB_WORKSPACE');
11
+ const commandInGhWorkspace = `cd ${ghWorkspace}; ${command}`;
12
+ const commandResult = spawnSync(commandInGhWorkspace, args, { shell: true, maxBuffer: 100 * 1024 * 1024 });
13
+
14
+ if (commandResult.error) {
15
+ throw new Error(`[Command failed]: ${commandInGhWorkspace}\n${commandResult.error}`);
16
+ }
17
+
18
+ if (commandResult.stderr.toString().length > 0) {
19
+ // For some reason 'git' command prints stderr when checking out to detached HEAD state (we only use detached HEAD for testing though)
20
+ if (!commandResult.stderr.toString().includes(`You are in 'detached HEAD' state`)) {
21
+ throw new Error(`[Command printed stderr]: ${commandInGhWorkspace}\n${commandResult.stderr.toString()}`);
22
+ }
23
+ }
24
+
25
+ return commandResult.stdout.toString().trim();
26
+ };
27
+
28
+ export const getRepoName = (githubEvent: GitHubEvent) => {
29
+ const [, repoName] = githubEvent.repository.full_name.split('/');
30
+ return repoName;
31
+ };
32
+
33
+ export const getEnvVar = (varName: string, defaultValue?: string): string => {
34
+ const value = process.env[varName] ?? defaultValue;
35
+ if (!value) {
36
+ throw new Error(`${varName} not defined`);
37
+ }
38
+ return value;
39
+ };
40
+
41
+ export const getRunUrlKvsKey = (runnerName: string) => {
42
+ return `RUN_URL-${runnerName}`;
43
+ };
44
+
45
+ /**
46
+ * Reads and parses all directories in `actors` directory
47
+ * This works locally if checkoutRepoLocally is called first
48
+ */
49
+ export const getRepoActors = async (): Promise<ActorConfig[]> => {
50
+ const ghWorkspace = getEnvVar('GITHUB_WORKSPACE');
51
+ let actorDirs: string[];
52
+ try {
53
+ actorDirs = (await fs.readdir(`${ghWorkspace}/actors`)).map((dir) => `actors/${dir}`);
54
+ } catch (err) {
55
+ console.warn(`No /actors directory found in repo`);
56
+ actorDirs = [];
57
+ }
58
+ let standaloneActorDirs: string[];
59
+ try {
60
+ standaloneActorDirs = (await fs.readdir(`${ghWorkspace}/standalone-actors`)).map((dir) => `standalone-actors/${dir}`);
61
+ } catch (err) {
62
+ console.warn(`No /standalone-actors directory found in repo`);
63
+ standaloneActorDirs = [];
64
+ }
65
+ const actorConfigs: ActorConfig[] = [];
66
+ for (const actorDir of [...actorDirs, ...standaloneActorDirs]) {
67
+ const match = actorDir.match(/^([^/]+)\/(.+)_([^_]+)$/);
68
+ if (!match) {
69
+ throw new Error(`Invalid actor directory name. Got "${actorDir}", expected "actor.owner-name_actor-name"`);
70
+ }
71
+ const [, folderType, owner, actorName] = match;
72
+ actorConfigs.push({
73
+ actorName: `${owner}/${actorName}`,
74
+ folder: actorDir,
75
+ isStandalone: folderType === 'standalone-actors',
76
+ });
77
+ }
78
+ console.error(`Actors in repo: ${actorConfigs.filter(({ isStandalone }) => !isStandalone).map(({ actorName }) => actorName).join(', ')}`);
79
+ console.error(`Standalone actors in repo: ${actorConfigs.filter(({ isStandalone }) => !!isStandalone).map(({ actorName }) => actorName).join(', ')}`);
80
+ return actorConfigs;
81
+ };
82
+
83
+ export const getHeadCommitSha = (githubEvent: GitHubEvent) => {
84
+ return githubEvent.type === 'pull_request'
85
+ ? githubEvent.pull_request.head.sha
86
+ : githubEvent.head_commit.id;
87
+ };
88
+
89
+ export interface GetChangedActorsResult {
90
+ actorsChanged: ActorConfig[];
91
+ codeChanged: boolean;
92
+ }
93
+
94
+ interface ShouldBuildAndTestOptions {
95
+ filepathsChanged: string[];
96
+ actorConfigs: ActorConfig[];
97
+ // Just for logging
98
+ isLatest?: boolean;
99
+ }
100
+
101
+ /**
102
+ * Also works for folders
103
+ */
104
+ const isIgnoredTopLevelFile = (lowercaseFilePath: string) => {
105
+ // On top level, we should only have dev-only readme and .actor/ is just for apify push CLI (real Actor configs are in /actors)
106
+ const IGNORED_TOP_LEVEL_FILES = ['.vscode/', '.gitignore', 'readme.md', '.husky/', '.eslintrc', '.editorconfig', '.actor/'];
107
+ // Strip out deprecated /code and /shared folders, treat them as top-level code
108
+ const sanitizedLowercaseFilePath = lowercaseFilePath.replace(/^code\//, '').replace(/^shared\//, '');
109
+
110
+ return IGNORED_TOP_LEVEL_FILES.some((ignoredFile) => sanitizedLowercaseFilePath.startsWith(ignoredFile));
111
+ };
112
+
113
+ const isLatestBuildOnlyFile = (lowercaseFilePath: string) => {
114
+ if (lowercaseFilePath.endsWith('changelog.md')) {
115
+ return true;
116
+ }
117
+
118
+ // Either in /actors or /standalone-actors, we need to rebuild readme but we don't rebuild top-level dev-only readme
119
+ if ((lowercaseFilePath.startsWith('actors/') || lowercaseFilePath.startsWith('standalone-actors/')) && lowercaseFilePath.endsWith('readme.md')) {
120
+ return true;
121
+ }
122
+
123
+ return false;
124
+ };
125
+
126
+ /**
127
+ * Latest and devel are the same except that for latest we also rebuild with README and CHANGELOG files
128
+ */
129
+ export const getChangedActors = (
130
+ { filepathsChanged, actorConfigs, isLatest = false }: ShouldBuildAndTestOptions,
131
+ ): GetChangedActorsResult => {
132
+ let codeChanged = false;
133
+ // folder -> ActorConfig
134
+ const actorsChangedMap = new Map<string, ActorConfig>();
135
+
136
+ const actorConfigsWithoutStandalone = actorConfigs.filter(({ isStandalone }) => !isStandalone);
137
+
138
+ const lowercaseFiles = filepathsChanged.map((file) => file.toLowerCase());
139
+
140
+ for (const lowercaseFilePath of lowercaseFiles) {
141
+ if (isIgnoredTopLevelFile(lowercaseFilePath)) {
142
+ continue;
143
+ }
144
+ // First we check for specific actors that have configs in /actors or standalone actors in /standalone-actors
145
+ // This matches both actors/username_actorName and standalone-actors/username_actorName
146
+ const changedActorConfigMatch = lowercaseFilePath.match(/^(?:standalone-)?actors\/([^/]+)\/.+/);
147
+ if (changedActorConfigMatch) {
148
+ const sanitizedActorName = changedActorConfigMatch[1].replace('_', '/');
149
+ const actorConfigChanged = actorConfigs.find(({ actorName }) => actorName.toLowerCase() === sanitizedActorName);
150
+ if (actorConfigChanged === undefined) {
151
+ console.warn('changes was found in an actor folder which no longer exists in the current commit', {
152
+ actorName: sanitizedActorName,
153
+ actorFolderName: changedActorConfigMatch[1],
154
+ });
155
+ continue;
156
+ }
157
+
158
+ console.error(`actorConfigChanged ${actorConfigChanged.actorName}: sanitizedActorName ${sanitizedActorName} ${lowercaseFilePath} `);
159
+ // These can be nested at various folders inside the actor folder
160
+ if (isLatest || !isLatestBuildOnlyFile(lowercaseFilePath)) {
161
+ // We assume other files will are either actor.json or input_schema.json and those needs to be tested
162
+ // TODO: Check what changed in schema, we don't need to test description changes
163
+ actorsChangedMap.set(actorConfigChanged.folder, actorConfigChanged);
164
+ }
165
+ continue;
166
+ }
167
+
168
+ // We check top level files (formerly in /code and /shared folders) that are shared among all non-standalone Actors
169
+ // Standalone actors are always handled separately by name via changedActorConfigMatch
170
+ if (isLatest || !isLatestBuildOnlyFile(lowercaseFilePath)) {
171
+ codeChanged = !isLatest; // NOTE: code is changed only in PR
172
+ for (const actorConfig of actorConfigsWithoutStandalone) {
173
+ actorsChangedMap.set(actorConfig.folder, actorConfig);
174
+ }
175
+ }
176
+ }
177
+
178
+ const actorsChanged = Array.from(actorsChangedMap.values());
179
+
180
+ // All below here is just for logging
181
+ const ignoredFilesChanged = lowercaseFiles.filter((file) => isIgnoredTopLevelFile(file));
182
+ console.error(`[DIFF]: Top level files changed that we ignore (don't trigger test or build): ${ignoredFilesChanged.join(', ')}`);
183
+
184
+ const onlyLatestFilesChanged = lowercaseFiles.filter((file) => isLatestBuildOnlyFile(file));
185
+ console.error(`[DIFF]: Files changed that only trigger latest build: ${onlyLatestFilesChanged.join(', ')}`);
186
+
187
+ if (!isLatest && codeChanged) {
188
+ console.error(`[DIFF]: All non-standalone Actors need to be built and tested (changes in top-level code)`);
189
+ }
190
+
191
+ if (actorsChanged.length > 0) {
192
+ const miniactors = actorsChanged.filter((config) => !config.isStandalone).map((config) => config.actorName);
193
+ const standaloneActors = actorsChanged.filter((config) => config.isStandalone).map((config) => config.actorName);
194
+ console.error(`[DIFF]: MiniActors to be built and tested: ${miniactors.join(', ')}`);
195
+ console.error(`[DIFF]: Standalone Actors to be built and tested: ${standaloneActors.join(', ')}`);
196
+ } else {
197
+ console.error(`[DIFF]: No relevant files changed, skipping builds and tests`);
198
+ }
199
+
200
+ return {
201
+ actorsChanged,
202
+ codeChanged,
203
+ };
204
+ };
@@ -0,0 +1,18 @@
1
+ import type { ActorConfig, BuildData } from './types.js';
2
+ type BuildPrActorOptions = {
3
+ buildTag?: string;
4
+ versionNumber: string;
5
+ gitRepoUrl: string;
6
+ actorName: string;
7
+ };
8
+ type RunBuildsOptions = {
9
+ actorConfigs: ActorConfig[];
10
+ isLatest?: boolean;
11
+ repoUrl: string;
12
+ branch: string;
13
+ dryRun: boolean;
14
+ };
15
+ export declare const runBuilds: ({ repoUrl, branch, actorConfigs, isLatest, dryRun, }: RunBuildsOptions) => Promise<BuildPrActorOptions[] | BuildData[]>;
16
+ export declare const deleteOldBuilds: (actorConfigs: ActorConfig[]) => Promise<void>;
17
+ export {};
18
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../bin/build.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGzD,KAAK,mBAAmB,GAAG;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAA;AA4KD,KAAK,gBAAgB,GAAG;IACpB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,SAAS,yDAMnB,gBAAgB,iDAyClB,CAAC;AAEF,eAAO,MAAM,eAAe,iBAAwB,WAAW,EAAE,kBAIhE,CAAC"}