@invarn/cibuild 1.3.15 → 1.3.17
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/cli.cjs +1 -1
- package/dist/src/cli.d.ts +3 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +987 -0
- package/dist/src/commands/android-scanner.d.ts +32 -0
- package/dist/src/commands/android-scanner.d.ts.map +1 -0
- package/dist/src/commands/android-scanner.js +667 -0
- package/dist/src/commands/build.d.ts +5 -0
- package/dist/src/commands/build.d.ts.map +1 -0
- package/dist/src/commands/build.js +1096 -0
- package/dist/src/commands/edit.d.ts +3 -0
- package/dist/src/commands/edit.d.ts.map +1 -0
- package/dist/src/commands/edit.js +651 -0
- package/dist/src/commands/file-secret-collector.d.ts +37 -0
- package/dist/src/commands/file-secret-collector.d.ts.map +1 -0
- package/dist/src/commands/file-secret-collector.js +199 -0
- package/dist/src/commands/github-workflow.d.ts +5 -0
- package/dist/src/commands/github-workflow.d.ts.map +1 -0
- package/dist/src/commands/github-workflow.js +45 -0
- package/dist/src/commands/ios-scanner.d.ts +27 -0
- package/dist/src/commands/ios-scanner.d.ts.map +1 -0
- package/dist/src/commands/ios-scanner.js +337 -0
- package/dist/src/commands/reset.d.ts +7 -0
- package/dist/src/commands/reset.d.ts.map +1 -0
- package/dist/src/commands/reset.js +81 -0
- package/dist/src/commands/secrets-sync-workflow.d.ts +15 -0
- package/dist/src/commands/secrets-sync-workflow.d.ts.map +1 -0
- package/dist/src/commands/secrets-sync-workflow.js +255 -0
- package/dist/src/commands/secrets-upload.d.ts +21 -0
- package/dist/src/commands/secrets-upload.d.ts.map +1 -0
- package/dist/src/commands/secrets-upload.js +177 -0
- package/dist/src/commands/secrets-upload.test.d.ts +5 -0
- package/dist/src/commands/secrets-upload.test.d.ts.map +1 -0
- package/dist/src/commands/secrets-upload.test.js +60 -0
- package/dist/src/config.d.ts +3 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +46 -0
- package/dist/src/envman/cli.d.ts +21 -0
- package/dist/src/envman/cli.d.ts.map +1 -0
- package/dist/src/envman/cli.js +240 -0
- package/dist/src/envman/envman.d.ts +83 -0
- package/dist/src/envman/envman.d.ts.map +1 -0
- package/dist/src/envman/envman.js +361 -0
- package/dist/src/envman/envman.test.d.ts +5 -0
- package/dist/src/envman/envman.test.d.ts.map +1 -0
- package/dist/src/envman/envman.test.js +236 -0
- package/dist/src/envman/index.d.ts +23 -0
- package/dist/src/envman/index.d.ts.map +1 -0
- package/dist/src/envman/index.js +23 -0
- package/dist/src/envman/types.d.ts +55 -0
- package/dist/src/envman/types.d.ts.map +1 -0
- package/dist/src/envman/types.js +12 -0
- package/dist/src/lib.d.ts +27 -0
- package/dist/src/lib.d.ts.map +1 -0
- package/dist/src/lib.js +32 -0
- package/dist/src/pipeline.d.ts +3 -0
- package/dist/src/pipeline.d.ts.map +1 -0
- package/dist/src/pipeline.js +57 -0
- package/dist/src/runner.d.ts +17 -0
- package/dist/src/runner.d.ts.map +1 -0
- package/dist/src/runner.js +234 -0
- package/dist/src/types.d.ts +57 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/yaml/bitrise-compat.d.ts +65 -0
- package/dist/src/yaml/bitrise-compat.d.ts.map +1 -0
- package/dist/src/yaml/bitrise-compat.js +206 -0
- package/dist/src/yaml/bitrise-compat.test.d.ts +5 -0
- package/dist/src/yaml/bitrise-compat.test.d.ts.map +1 -0
- package/dist/src/yaml/bitrise-compat.test.js +347 -0
- package/dist/src/yaml/converter.d.ts +33 -0
- package/dist/src/yaml/converter.d.ts.map +1 -0
- package/dist/src/yaml/converter.js +222 -0
- package/dist/src/yaml/converter.test.d.ts +5 -0
- package/dist/src/yaml/converter.test.d.ts.map +1 -0
- package/dist/src/yaml/converter.test.js +348 -0
- package/dist/src/yaml/e2e.test.d.ts +6 -0
- package/dist/src/yaml/e2e.test.d.ts.map +1 -0
- package/dist/src/yaml/e2e.test.js +446 -0
- package/dist/src/yaml/env-resolver.d.ts +120 -0
- package/dist/src/yaml/env-resolver.d.ts.map +1 -0
- package/dist/src/yaml/env-resolver.js +405 -0
- package/dist/src/yaml/env-resolver.test.d.ts +5 -0
- package/dist/src/yaml/env-resolver.test.d.ts.map +1 -0
- package/dist/src/yaml/env-resolver.test.js +502 -0
- package/dist/src/yaml/interactive-prompts.d.ts +71 -0
- package/dist/src/yaml/interactive-prompts.d.ts.map +1 -0
- package/dist/src/yaml/interactive-prompts.js +258 -0
- package/dist/src/yaml/missing-env-handler.d.ts +45 -0
- package/dist/src/yaml/missing-env-handler.d.ts.map +1 -0
- package/dist/src/yaml/missing-env-handler.js +64 -0
- package/dist/src/yaml/parser.d.ts +33 -0
- package/dist/src/yaml/parser.d.ts.map +1 -0
- package/dist/src/yaml/parser.js +145 -0
- package/dist/src/yaml/pipeline-with-secrets.d.ts +25 -0
- package/dist/src/yaml/pipeline-with-secrets.d.ts.map +1 -0
- package/dist/src/yaml/pipeline-with-secrets.js +76 -0
- package/dist/src/yaml/platform-detector.d.ts +83 -0
- package/dist/src/yaml/platform-detector.d.ts.map +1 -0
- package/dist/src/yaml/platform-detector.js +188 -0
- package/dist/src/yaml/platform-detector.test.d.ts +5 -0
- package/dist/src/yaml/platform-detector.test.d.ts.map +1 -0
- package/dist/src/yaml/platform-detector.test.js +414 -0
- package/dist/src/yaml/preflight-validation.d.ts +40 -0
- package/dist/src/yaml/preflight-validation.d.ts.map +1 -0
- package/dist/src/yaml/preflight-validation.js +152 -0
- package/dist/src/yaml/secrets-manager.d.ts +77 -0
- package/dist/src/yaml/secrets-manager.d.ts.map +1 -0
- package/dist/src/yaml/secrets-manager.js +219 -0
- package/dist/src/yaml/step-validator.d.ts +54 -0
- package/dist/src/yaml/step-validator.d.ts.map +1 -0
- package/dist/src/yaml/step-validator.js +403 -0
- package/dist/src/yaml/steps/android-sign.d.ts +35 -0
- package/dist/src/yaml/steps/android-sign.d.ts.map +1 -0
- package/dist/src/yaml/steps/android-sign.js +147 -0
- package/dist/src/yaml/steps/android-version.d.ts +26 -0
- package/dist/src/yaml/steps/android-version.d.ts.map +1 -0
- package/dist/src/yaml/steps/android-version.js +128 -0
- package/dist/src/yaml/steps/android-version.test.d.ts +5 -0
- package/dist/src/yaml/steps/android-version.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/android-version.test.js +196 -0
- package/dist/src/yaml/steps/android.d.ts +95 -0
- package/dist/src/yaml/steps/android.d.ts.map +1 -0
- package/dist/src/yaml/steps/android.js +916 -0
- package/dist/src/yaml/steps/app-store-deploy.d.ts +48 -0
- package/dist/src/yaml/steps/app-store-deploy.d.ts.map +1 -0
- package/dist/src/yaml/steps/app-store-deploy.js +162 -0
- package/dist/src/yaml/steps/base.d.ts +238 -0
- package/dist/src/yaml/steps/base.d.ts.map +1 -0
- package/dist/src/yaml/steps/base.js +345 -0
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts +26 -0
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-android-tools.js +198 -0
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-android-tools.test.js +280 -0
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts +22 -0
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-apk-info.js +144 -0
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-apk-info.test.js +331 -0
- package/dist/src/yaml/steps/bitrise-slack.d.ts +49 -0
- package/dist/src/yaml/steps/bitrise-slack.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-slack.js +280 -0
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-slack.test.js +484 -0
- package/dist/src/yaml/steps/bitrise-ssh.d.ts +27 -0
- package/dist/src/yaml/steps/bitrise-ssh.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-ssh.js +134 -0
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-ssh.test.js +205 -0
- package/dist/src/yaml/steps/cache.d.ts +52 -0
- package/dist/src/yaml/steps/cache.d.ts.map +1 -0
- package/dist/src/yaml/steps/cache.js +351 -0
- package/dist/src/yaml/steps/fastlane.d.ts +27 -0
- package/dist/src/yaml/steps/fastlane.d.ts.map +1 -0
- package/dist/src/yaml/steps/fastlane.js +79 -0
- package/dist/src/yaml/steps/file.d.ts +27 -0
- package/dist/src/yaml/steps/file.d.ts.map +1 -0
- package/dist/src/yaml/steps/file.js +35 -0
- package/dist/src/yaml/steps/flutter.d.ts +63 -0
- package/dist/src/yaml/steps/flutter.d.ts.map +1 -0
- package/dist/src/yaml/steps/flutter.js +215 -0
- package/dist/src/yaml/steps/git-clone.d.ts +26 -0
- package/dist/src/yaml/steps/git-clone.d.ts.map +1 -0
- package/dist/src/yaml/steps/git-clone.js +111 -0
- package/dist/src/yaml/steps/google-play-deploy.d.ts +37 -0
- package/dist/src/yaml/steps/google-play-deploy.d.ts.map +1 -0
- package/dist/src/yaml/steps/google-play-deploy.js +193 -0
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts +5 -0
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/google-play-deploy.test.js +310 -0
- package/dist/src/yaml/steps/index.d.ts +10 -0
- package/dist/src/yaml/steps/index.d.ts.map +1 -0
- package/dist/src/yaml/steps/index.js +1361 -0
- package/dist/src/yaml/steps/ios-deps.d.ts +43 -0
- package/dist/src/yaml/steps/ios-deps.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-deps.js +141 -0
- package/dist/src/yaml/steps/ios-deps.test.d.ts +5 -0
- package/dist/src/yaml/steps/ios-deps.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-deps.test.js +90 -0
- package/dist/src/yaml/steps/ios-signing.d.ts +31 -0
- package/dist/src/yaml/steps/ios-signing.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-signing.js +144 -0
- package/dist/src/yaml/steps/ios-version.d.ts +47 -0
- package/dist/src/yaml/steps/ios-version.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-version.js +151 -0
- package/dist/src/yaml/steps/linting.d.ts +47 -0
- package/dist/src/yaml/steps/linting.d.ts.map +1 -0
- package/dist/src/yaml/steps/linting.js +148 -0
- package/dist/src/yaml/steps/phase2.test.d.ts +6 -0
- package/dist/src/yaml/steps/phase2.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase2.test.js +197 -0
- package/dist/src/yaml/steps/phase3.test.d.ts +5 -0
- package/dist/src/yaml/steps/phase3.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase3.test.js +144 -0
- package/dist/src/yaml/steps/phase4.test.d.ts +5 -0
- package/dist/src/yaml/steps/phase4.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase4.test.js +166 -0
- package/dist/src/yaml/steps/phase5.test.d.ts +6 -0
- package/dist/src/yaml/steps/phase5.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase5.test.js +263 -0
- package/dist/src/yaml/steps/registry.d.ts +88 -0
- package/dist/src/yaml/steps/registry.d.ts.map +1 -0
- package/dist/src/yaml/steps/registry.js +125 -0
- package/dist/src/yaml/steps/registry.test.d.ts +5 -0
- package/dist/src/yaml/steps/registry.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/registry.test.js +235 -0
- package/dist/src/yaml/steps/release.d.ts +50 -0
- package/dist/src/yaml/steps/release.d.ts.map +1 -0
- package/dist/src/yaml/steps/release.js +154 -0
- package/dist/src/yaml/steps/script.d.ts +23 -0
- package/dist/src/yaml/steps/script.d.ts.map +1 -0
- package/dist/src/yaml/steps/script.js +63 -0
- package/dist/src/yaml/steps/spec-validation.test.d.ts +6 -0
- package/dist/src/yaml/steps/spec-validation.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/spec-validation.test.js +130 -0
- package/dist/src/yaml/steps/steps.test.d.ts +6 -0
- package/dist/src/yaml/steps/steps.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/steps.test.js +474 -0
- package/dist/src/yaml/steps/test-config.d.ts +3 -0
- package/dist/src/yaml/steps/test-config.d.ts.map +1 -0
- package/dist/src/yaml/steps/test-config.js +16 -0
- package/dist/src/yaml/steps/xcode-new.test.d.ts +5 -0
- package/dist/src/yaml/steps/xcode-new.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/xcode-new.test.js +211 -0
- package/dist/src/yaml/steps/xcode.d.ts +222 -0
- package/dist/src/yaml/steps/xcode.d.ts.map +1 -0
- package/dist/src/yaml/steps/xcode.js +999 -0
- package/dist/src/yaml/types.d.ts +68 -0
- package/dist/src/yaml/types.d.ts.map +1 -0
- package/dist/src/yaml/types.js +5 -0
- package/dist/src/yaml/validation-types.d.ts +96 -0
- package/dist/src/yaml/validation-types.d.ts.map +1 -0
- package/dist/src/yaml/validation-types.js +8 -0
- package/dist/src/yaml/yaml-updater.d.ts +24 -0
- package/dist/src/yaml/yaml-updater.d.ts.map +1 -0
- package/dist/src/yaml/yaml-updater.js +128 -0
- package/package.json +16 -4
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script step implementation
|
|
3
|
+
*/
|
|
4
|
+
import { BaseStepExecutor } from './base.js';
|
|
5
|
+
import type { StepDef, CIConfig } from '../../types.js';
|
|
6
|
+
import type { ValidationRequirement } from '../validation-types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Inputs for script step
|
|
9
|
+
*/
|
|
10
|
+
export interface ScriptInputs {
|
|
11
|
+
content?: string;
|
|
12
|
+
working_dir?: string;
|
|
13
|
+
runner_bin?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Script step executor
|
|
17
|
+
* Executes arbitrary shell scripts with optional working directory
|
|
18
|
+
*/
|
|
19
|
+
export declare class ScriptStepExecutor extends BaseStepExecutor {
|
|
20
|
+
getValidationRequirements(inputs: ScriptInputs, _env: Record<string, string>, _config: CIConfig): ValidationRequirement[];
|
|
21
|
+
execute(inputs: ScriptInputs, env: Record<string, string>, config: CIConfig): Promise<StepDef>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=script.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/script.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,gBAAgB;IACtD,yBAAyB,CACvB,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,OAAO,EAAE,QAAQ,GAChB,qBAAqB,EAAE;IAmBpB,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAkDrG"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script step implementation
|
|
3
|
+
*/
|
|
4
|
+
import { BaseStepExecutor } from './base.js';
|
|
5
|
+
/**
|
|
6
|
+
* Script step executor
|
|
7
|
+
* Executes arbitrary shell scripts with optional working directory
|
|
8
|
+
*/
|
|
9
|
+
export class ScriptStepExecutor extends BaseStepExecutor {
|
|
10
|
+
getValidationRequirements(inputs, _env, _config) {
|
|
11
|
+
const requirements = [];
|
|
12
|
+
// content is required
|
|
13
|
+
requirements.push(this.requireInput('content', inputs, 'Script content to execute', 'Provide content input with your script'));
|
|
14
|
+
// Check runner if non-bash
|
|
15
|
+
const runner = this.getInput(inputs, 'runner_bin', 'bash');
|
|
16
|
+
if (runner !== 'bash' && !runner.includes('bash')) {
|
|
17
|
+
requirements.push(this.requireCommand(runner, `Script runner: ${runner}`, `Install ${runner} or use bash as the runner`));
|
|
18
|
+
}
|
|
19
|
+
return requirements;
|
|
20
|
+
}
|
|
21
|
+
async execute(inputs, env, config) {
|
|
22
|
+
const stepName = 'script';
|
|
23
|
+
// Get script content - this is required
|
|
24
|
+
const content = this.getRequiredInput(inputs, 'content', stepName);
|
|
25
|
+
// Get working directory - optional, defaults to current directory
|
|
26
|
+
const workingDir = this.getInput(inputs, 'working_dir', '');
|
|
27
|
+
// Get runner bin - optional, defaults to bash
|
|
28
|
+
const runnerBin = this.getInput(inputs, 'runner_bin', 'bash');
|
|
29
|
+
const commands = [];
|
|
30
|
+
// Change to working directory if specified
|
|
31
|
+
if (workingDir && workingDir.trim() !== '') {
|
|
32
|
+
commands.push(`# Changing to working directory: ${this.escapeBash(workingDir)}`);
|
|
33
|
+
commands.push(`cd '${this.escapeBash(workingDir)}'`);
|
|
34
|
+
commands.push('');
|
|
35
|
+
}
|
|
36
|
+
// Add the user's script content
|
|
37
|
+
commands.push('# User script content');
|
|
38
|
+
commands.push(content);
|
|
39
|
+
const script = this.createBashScriptFromCommands(commands, stepName);
|
|
40
|
+
// Determine the kind based on runner_bin
|
|
41
|
+
let kind = 'script';
|
|
42
|
+
if (runnerBin.includes('python')) {
|
|
43
|
+
kind = 'python';
|
|
44
|
+
}
|
|
45
|
+
else if (runnerBin.includes('ruby')) {
|
|
46
|
+
kind = 'ruby';
|
|
47
|
+
}
|
|
48
|
+
else if (runnerBin.includes('node')) {
|
|
49
|
+
kind = 'node';
|
|
50
|
+
}
|
|
51
|
+
// For non-bash runners, return the content directly
|
|
52
|
+
if (kind !== 'script') {
|
|
53
|
+
return {
|
|
54
|
+
id: '',
|
|
55
|
+
name: stepName,
|
|
56
|
+
kind,
|
|
57
|
+
script: content,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return this.createScriptStep(script, stepName);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-validation.test.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/spec-validation.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates that step spec YAML files stay in sync with the step registry
|
|
3
|
+
* and that bitrise-map.yml is consistent.
|
|
4
|
+
*/
|
|
5
|
+
import { describe, test, expect, beforeAll } from '@jest/globals';
|
|
6
|
+
import { readFileSync, readdirSync } from 'node:fs';
|
|
7
|
+
import { resolve, dirname } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { load } from 'js-yaml';
|
|
10
|
+
import { getAvailableSteps, clearRegistry } from './registry.js';
|
|
11
|
+
import { initializeStepRegistry } from './index.js';
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = dirname(__filename);
|
|
14
|
+
const stepsDir = resolve(__dirname, '../../../steps');
|
|
15
|
+
function loadSpecFiles() {
|
|
16
|
+
const files = readdirSync(stepsDir).filter((f) => f.endsWith('.yml') && f !== 'bitrise-map.yml');
|
|
17
|
+
const specs = new Map();
|
|
18
|
+
for (const file of files) {
|
|
19
|
+
const content = readFileSync(resolve(stepsDir, file), 'utf-8');
|
|
20
|
+
const spec = load(content);
|
|
21
|
+
specs.set(spec.name, spec);
|
|
22
|
+
}
|
|
23
|
+
return specs;
|
|
24
|
+
}
|
|
25
|
+
function loadBitriseMap() {
|
|
26
|
+
const content = readFileSync(resolve(stepsDir, 'bitrise-map.yml'), 'utf-8');
|
|
27
|
+
return load(content);
|
|
28
|
+
}
|
|
29
|
+
// Ensure registry is populated (other tests may clear it)
|
|
30
|
+
let registeredSteps;
|
|
31
|
+
beforeAll(() => {
|
|
32
|
+
clearRegistry();
|
|
33
|
+
initializeStepRegistry();
|
|
34
|
+
registeredSteps = getAvailableSteps();
|
|
35
|
+
});
|
|
36
|
+
describe('Step spec YAML files', () => {
|
|
37
|
+
const specs = loadSpecFiles();
|
|
38
|
+
test('every spec file parses with required fields', () => {
|
|
39
|
+
for (const [name, spec] of specs) {
|
|
40
|
+
expect(spec.name).toBeTruthy();
|
|
41
|
+
expect(spec.version).toBe('1.0.0');
|
|
42
|
+
expect(['all', 'ios', 'android']).toContain(spec.platform);
|
|
43
|
+
expect(spec.description).toBeTruthy();
|
|
44
|
+
expect(spec.agent_notes).toBeTruthy();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
test('spec file name matches the name field inside', () => {
|
|
48
|
+
const files = readdirSync(stepsDir).filter((f) => f.endsWith('.yml') && f !== 'bitrise-map.yml');
|
|
49
|
+
for (const file of files) {
|
|
50
|
+
const content = readFileSync(resolve(stepsDir, file), 'utf-8');
|
|
51
|
+
const spec = load(content);
|
|
52
|
+
const expectedFileName = `${spec.name}.yml`;
|
|
53
|
+
expect(file).toBe(expectedFileName);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
test('every registered step in the registry has a matching spec file', () => {
|
|
57
|
+
const specNames = Array.from(specs.keys());
|
|
58
|
+
for (const step of registeredSteps) {
|
|
59
|
+
expect(specNames).toContain(step);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
test('every spec file references a step that exists in the registry', () => {
|
|
63
|
+
for (const [name] of specs) {
|
|
64
|
+
expect(registeredSteps).toContain(name);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
test('spec inputs have descriptions', () => {
|
|
68
|
+
for (const [name, spec] of specs) {
|
|
69
|
+
if (!spec.inputs)
|
|
70
|
+
continue;
|
|
71
|
+
for (const [inputName, input] of Object.entries(spec.inputs)) {
|
|
72
|
+
expect(input.description).toBeTruthy();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
test('spec outputs have names and descriptions', () => {
|
|
77
|
+
for (const [name, spec] of specs) {
|
|
78
|
+
if (!spec.outputs)
|
|
79
|
+
continue;
|
|
80
|
+
for (const output of spec.outputs) {
|
|
81
|
+
expect(output.name).toBeTruthy();
|
|
82
|
+
expect(output.description).toBeTruthy();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
test('spec examples are present', () => {
|
|
87
|
+
for (const [name, spec] of specs) {
|
|
88
|
+
expect(spec.example).toBeTruthy();
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
describe('Bitrise migration map', () => {
|
|
93
|
+
const bitriseMap = loadBitriseMap();
|
|
94
|
+
const specs = loadSpecFiles();
|
|
95
|
+
test('parses correctly with required fields', () => {
|
|
96
|
+
expect(bitriseMap.mappings).toBeDefined();
|
|
97
|
+
expect(Array.isArray(bitriseMap.mappings)).toBe(true);
|
|
98
|
+
expect(bitriseMap.mappings.length).toBeGreaterThan(0);
|
|
99
|
+
for (const mapping of bitriseMap.mappings) {
|
|
100
|
+
expect(mapping.bitrise_step).toBeTruthy();
|
|
101
|
+
expect(mapping.bitrise_version_ported).toBeTruthy();
|
|
102
|
+
expect(mapping.cibuild_step).toBeTruthy();
|
|
103
|
+
expect(mapping.notes).toBeTruthy();
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
test('every cibuild_step references a step that exists in specs', () => {
|
|
107
|
+
const specNames = Array.from(specs.keys());
|
|
108
|
+
for (const mapping of bitriseMap.mappings) {
|
|
109
|
+
// cibuild_step is formatted as "step-name@1.0.0"
|
|
110
|
+
const stepName = mapping.cibuild_step.replace(/@.*$/, '');
|
|
111
|
+
expect(specNames).toContain(stepName);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
test('all cibuild_step references use @1.0.0 version', () => {
|
|
115
|
+
for (const mapping of bitriseMap.mappings) {
|
|
116
|
+
expect(mapping.cibuild_step).toMatch(/@1\.0\.0$/);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
test('bitrise step aliases are unique', () => {
|
|
120
|
+
const bitriseNames = bitriseMap.mappings.map((m) => m.bitrise_step);
|
|
121
|
+
const uniqueNames = new Set(bitriseNames);
|
|
122
|
+
expect(uniqueNames.size).toBe(bitriseNames.length);
|
|
123
|
+
});
|
|
124
|
+
test('cibuild step targets are unique (no duplicate mappings)', () => {
|
|
125
|
+
const cibuildSteps = bitriseMap.mappings.map((m) => m.cibuild_step);
|
|
126
|
+
const uniqueSteps = new Set(cibuildSteps);
|
|
127
|
+
expect(uniqueSteps.size).toBe(cibuildSteps.length);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
//# sourceMappingURL=spec-validation.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steps.test.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/steps.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|