@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.
Files changed (242) hide show
  1. package/dist/cli.cjs +1 -1
  2. package/dist/src/cli.d.ts +3 -0
  3. package/dist/src/cli.d.ts.map +1 -0
  4. package/dist/src/cli.js +987 -0
  5. package/dist/src/commands/android-scanner.d.ts +32 -0
  6. package/dist/src/commands/android-scanner.d.ts.map +1 -0
  7. package/dist/src/commands/android-scanner.js +667 -0
  8. package/dist/src/commands/build.d.ts +5 -0
  9. package/dist/src/commands/build.d.ts.map +1 -0
  10. package/dist/src/commands/build.js +1096 -0
  11. package/dist/src/commands/edit.d.ts +3 -0
  12. package/dist/src/commands/edit.d.ts.map +1 -0
  13. package/dist/src/commands/edit.js +651 -0
  14. package/dist/src/commands/file-secret-collector.d.ts +37 -0
  15. package/dist/src/commands/file-secret-collector.d.ts.map +1 -0
  16. package/dist/src/commands/file-secret-collector.js +199 -0
  17. package/dist/src/commands/github-workflow.d.ts +5 -0
  18. package/dist/src/commands/github-workflow.d.ts.map +1 -0
  19. package/dist/src/commands/github-workflow.js +45 -0
  20. package/dist/src/commands/ios-scanner.d.ts +27 -0
  21. package/dist/src/commands/ios-scanner.d.ts.map +1 -0
  22. package/dist/src/commands/ios-scanner.js +337 -0
  23. package/dist/src/commands/reset.d.ts +7 -0
  24. package/dist/src/commands/reset.d.ts.map +1 -0
  25. package/dist/src/commands/reset.js +81 -0
  26. package/dist/src/commands/secrets-sync-workflow.d.ts +15 -0
  27. package/dist/src/commands/secrets-sync-workflow.d.ts.map +1 -0
  28. package/dist/src/commands/secrets-sync-workflow.js +255 -0
  29. package/dist/src/commands/secrets-upload.d.ts +21 -0
  30. package/dist/src/commands/secrets-upload.d.ts.map +1 -0
  31. package/dist/src/commands/secrets-upload.js +177 -0
  32. package/dist/src/commands/secrets-upload.test.d.ts +5 -0
  33. package/dist/src/commands/secrets-upload.test.d.ts.map +1 -0
  34. package/dist/src/commands/secrets-upload.test.js +60 -0
  35. package/dist/src/config.d.ts +3 -0
  36. package/dist/src/config.d.ts.map +1 -0
  37. package/dist/src/config.js +46 -0
  38. package/dist/src/envman/cli.d.ts +21 -0
  39. package/dist/src/envman/cli.d.ts.map +1 -0
  40. package/dist/src/envman/cli.js +240 -0
  41. package/dist/src/envman/envman.d.ts +83 -0
  42. package/dist/src/envman/envman.d.ts.map +1 -0
  43. package/dist/src/envman/envman.js +361 -0
  44. package/dist/src/envman/envman.test.d.ts +5 -0
  45. package/dist/src/envman/envman.test.d.ts.map +1 -0
  46. package/dist/src/envman/envman.test.js +236 -0
  47. package/dist/src/envman/index.d.ts +23 -0
  48. package/dist/src/envman/index.d.ts.map +1 -0
  49. package/dist/src/envman/index.js +23 -0
  50. package/dist/src/envman/types.d.ts +55 -0
  51. package/dist/src/envman/types.d.ts.map +1 -0
  52. package/dist/src/envman/types.js +12 -0
  53. package/dist/src/lib.d.ts +27 -0
  54. package/dist/src/lib.d.ts.map +1 -0
  55. package/dist/src/lib.js +32 -0
  56. package/dist/src/pipeline.d.ts +3 -0
  57. package/dist/src/pipeline.d.ts.map +1 -0
  58. package/dist/src/pipeline.js +57 -0
  59. package/dist/src/runner.d.ts +17 -0
  60. package/dist/src/runner.d.ts.map +1 -0
  61. package/dist/src/runner.js +234 -0
  62. package/dist/src/types.d.ts +57 -0
  63. package/dist/src/types.d.ts.map +1 -0
  64. package/dist/src/types.js +2 -0
  65. package/dist/src/yaml/bitrise-compat.d.ts +65 -0
  66. package/dist/src/yaml/bitrise-compat.d.ts.map +1 -0
  67. package/dist/src/yaml/bitrise-compat.js +206 -0
  68. package/dist/src/yaml/bitrise-compat.test.d.ts +5 -0
  69. package/dist/src/yaml/bitrise-compat.test.d.ts.map +1 -0
  70. package/dist/src/yaml/bitrise-compat.test.js +347 -0
  71. package/dist/src/yaml/converter.d.ts +33 -0
  72. package/dist/src/yaml/converter.d.ts.map +1 -0
  73. package/dist/src/yaml/converter.js +222 -0
  74. package/dist/src/yaml/converter.test.d.ts +5 -0
  75. package/dist/src/yaml/converter.test.d.ts.map +1 -0
  76. package/dist/src/yaml/converter.test.js +348 -0
  77. package/dist/src/yaml/e2e.test.d.ts +6 -0
  78. package/dist/src/yaml/e2e.test.d.ts.map +1 -0
  79. package/dist/src/yaml/e2e.test.js +446 -0
  80. package/dist/src/yaml/env-resolver.d.ts +120 -0
  81. package/dist/src/yaml/env-resolver.d.ts.map +1 -0
  82. package/dist/src/yaml/env-resolver.js +405 -0
  83. package/dist/src/yaml/env-resolver.test.d.ts +5 -0
  84. package/dist/src/yaml/env-resolver.test.d.ts.map +1 -0
  85. package/dist/src/yaml/env-resolver.test.js +502 -0
  86. package/dist/src/yaml/interactive-prompts.d.ts +71 -0
  87. package/dist/src/yaml/interactive-prompts.d.ts.map +1 -0
  88. package/dist/src/yaml/interactive-prompts.js +258 -0
  89. package/dist/src/yaml/missing-env-handler.d.ts +45 -0
  90. package/dist/src/yaml/missing-env-handler.d.ts.map +1 -0
  91. package/dist/src/yaml/missing-env-handler.js +64 -0
  92. package/dist/src/yaml/parser.d.ts +33 -0
  93. package/dist/src/yaml/parser.d.ts.map +1 -0
  94. package/dist/src/yaml/parser.js +145 -0
  95. package/dist/src/yaml/pipeline-with-secrets.d.ts +25 -0
  96. package/dist/src/yaml/pipeline-with-secrets.d.ts.map +1 -0
  97. package/dist/src/yaml/pipeline-with-secrets.js +76 -0
  98. package/dist/src/yaml/platform-detector.d.ts +83 -0
  99. package/dist/src/yaml/platform-detector.d.ts.map +1 -0
  100. package/dist/src/yaml/platform-detector.js +188 -0
  101. package/dist/src/yaml/platform-detector.test.d.ts +5 -0
  102. package/dist/src/yaml/platform-detector.test.d.ts.map +1 -0
  103. package/dist/src/yaml/platform-detector.test.js +414 -0
  104. package/dist/src/yaml/preflight-validation.d.ts +40 -0
  105. package/dist/src/yaml/preflight-validation.d.ts.map +1 -0
  106. package/dist/src/yaml/preflight-validation.js +152 -0
  107. package/dist/src/yaml/secrets-manager.d.ts +77 -0
  108. package/dist/src/yaml/secrets-manager.d.ts.map +1 -0
  109. package/dist/src/yaml/secrets-manager.js +219 -0
  110. package/dist/src/yaml/step-validator.d.ts +54 -0
  111. package/dist/src/yaml/step-validator.d.ts.map +1 -0
  112. package/dist/src/yaml/step-validator.js +403 -0
  113. package/dist/src/yaml/steps/android-sign.d.ts +35 -0
  114. package/dist/src/yaml/steps/android-sign.d.ts.map +1 -0
  115. package/dist/src/yaml/steps/android-sign.js +147 -0
  116. package/dist/src/yaml/steps/android-version.d.ts +26 -0
  117. package/dist/src/yaml/steps/android-version.d.ts.map +1 -0
  118. package/dist/src/yaml/steps/android-version.js +128 -0
  119. package/dist/src/yaml/steps/android-version.test.d.ts +5 -0
  120. package/dist/src/yaml/steps/android-version.test.d.ts.map +1 -0
  121. package/dist/src/yaml/steps/android-version.test.js +196 -0
  122. package/dist/src/yaml/steps/android.d.ts +95 -0
  123. package/dist/src/yaml/steps/android.d.ts.map +1 -0
  124. package/dist/src/yaml/steps/android.js +916 -0
  125. package/dist/src/yaml/steps/app-store-deploy.d.ts +48 -0
  126. package/dist/src/yaml/steps/app-store-deploy.d.ts.map +1 -0
  127. package/dist/src/yaml/steps/app-store-deploy.js +162 -0
  128. package/dist/src/yaml/steps/base.d.ts +238 -0
  129. package/dist/src/yaml/steps/base.d.ts.map +1 -0
  130. package/dist/src/yaml/steps/base.js +345 -0
  131. package/dist/src/yaml/steps/bitrise-android-tools.d.ts +26 -0
  132. package/dist/src/yaml/steps/bitrise-android-tools.d.ts.map +1 -0
  133. package/dist/src/yaml/steps/bitrise-android-tools.js +198 -0
  134. package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts +5 -0
  135. package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts.map +1 -0
  136. package/dist/src/yaml/steps/bitrise-android-tools.test.js +280 -0
  137. package/dist/src/yaml/steps/bitrise-apk-info.d.ts +22 -0
  138. package/dist/src/yaml/steps/bitrise-apk-info.d.ts.map +1 -0
  139. package/dist/src/yaml/steps/bitrise-apk-info.js +144 -0
  140. package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts +5 -0
  141. package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts.map +1 -0
  142. package/dist/src/yaml/steps/bitrise-apk-info.test.js +331 -0
  143. package/dist/src/yaml/steps/bitrise-slack.d.ts +49 -0
  144. package/dist/src/yaml/steps/bitrise-slack.d.ts.map +1 -0
  145. package/dist/src/yaml/steps/bitrise-slack.js +280 -0
  146. package/dist/src/yaml/steps/bitrise-slack.test.d.ts +5 -0
  147. package/dist/src/yaml/steps/bitrise-slack.test.d.ts.map +1 -0
  148. package/dist/src/yaml/steps/bitrise-slack.test.js +484 -0
  149. package/dist/src/yaml/steps/bitrise-ssh.d.ts +27 -0
  150. package/dist/src/yaml/steps/bitrise-ssh.d.ts.map +1 -0
  151. package/dist/src/yaml/steps/bitrise-ssh.js +134 -0
  152. package/dist/src/yaml/steps/bitrise-ssh.test.d.ts +5 -0
  153. package/dist/src/yaml/steps/bitrise-ssh.test.d.ts.map +1 -0
  154. package/dist/src/yaml/steps/bitrise-ssh.test.js +205 -0
  155. package/dist/src/yaml/steps/cache.d.ts +52 -0
  156. package/dist/src/yaml/steps/cache.d.ts.map +1 -0
  157. package/dist/src/yaml/steps/cache.js +351 -0
  158. package/dist/src/yaml/steps/fastlane.d.ts +27 -0
  159. package/dist/src/yaml/steps/fastlane.d.ts.map +1 -0
  160. package/dist/src/yaml/steps/fastlane.js +79 -0
  161. package/dist/src/yaml/steps/file.d.ts +27 -0
  162. package/dist/src/yaml/steps/file.d.ts.map +1 -0
  163. package/dist/src/yaml/steps/file.js +35 -0
  164. package/dist/src/yaml/steps/flutter.d.ts +63 -0
  165. package/dist/src/yaml/steps/flutter.d.ts.map +1 -0
  166. package/dist/src/yaml/steps/flutter.js +215 -0
  167. package/dist/src/yaml/steps/git-clone.d.ts +26 -0
  168. package/dist/src/yaml/steps/git-clone.d.ts.map +1 -0
  169. package/dist/src/yaml/steps/git-clone.js +111 -0
  170. package/dist/src/yaml/steps/google-play-deploy.d.ts +37 -0
  171. package/dist/src/yaml/steps/google-play-deploy.d.ts.map +1 -0
  172. package/dist/src/yaml/steps/google-play-deploy.js +193 -0
  173. package/dist/src/yaml/steps/google-play-deploy.test.d.ts +5 -0
  174. package/dist/src/yaml/steps/google-play-deploy.test.d.ts.map +1 -0
  175. package/dist/src/yaml/steps/google-play-deploy.test.js +310 -0
  176. package/dist/src/yaml/steps/index.d.ts +10 -0
  177. package/dist/src/yaml/steps/index.d.ts.map +1 -0
  178. package/dist/src/yaml/steps/index.js +1361 -0
  179. package/dist/src/yaml/steps/ios-deps.d.ts +43 -0
  180. package/dist/src/yaml/steps/ios-deps.d.ts.map +1 -0
  181. package/dist/src/yaml/steps/ios-deps.js +141 -0
  182. package/dist/src/yaml/steps/ios-deps.test.d.ts +5 -0
  183. package/dist/src/yaml/steps/ios-deps.test.d.ts.map +1 -0
  184. package/dist/src/yaml/steps/ios-deps.test.js +90 -0
  185. package/dist/src/yaml/steps/ios-signing.d.ts +31 -0
  186. package/dist/src/yaml/steps/ios-signing.d.ts.map +1 -0
  187. package/dist/src/yaml/steps/ios-signing.js +144 -0
  188. package/dist/src/yaml/steps/ios-version.d.ts +47 -0
  189. package/dist/src/yaml/steps/ios-version.d.ts.map +1 -0
  190. package/dist/src/yaml/steps/ios-version.js +151 -0
  191. package/dist/src/yaml/steps/linting.d.ts +47 -0
  192. package/dist/src/yaml/steps/linting.d.ts.map +1 -0
  193. package/dist/src/yaml/steps/linting.js +148 -0
  194. package/dist/src/yaml/steps/phase2.test.d.ts +6 -0
  195. package/dist/src/yaml/steps/phase2.test.d.ts.map +1 -0
  196. package/dist/src/yaml/steps/phase2.test.js +197 -0
  197. package/dist/src/yaml/steps/phase3.test.d.ts +5 -0
  198. package/dist/src/yaml/steps/phase3.test.d.ts.map +1 -0
  199. package/dist/src/yaml/steps/phase3.test.js +144 -0
  200. package/dist/src/yaml/steps/phase4.test.d.ts +5 -0
  201. package/dist/src/yaml/steps/phase4.test.d.ts.map +1 -0
  202. package/dist/src/yaml/steps/phase4.test.js +166 -0
  203. package/dist/src/yaml/steps/phase5.test.d.ts +6 -0
  204. package/dist/src/yaml/steps/phase5.test.d.ts.map +1 -0
  205. package/dist/src/yaml/steps/phase5.test.js +263 -0
  206. package/dist/src/yaml/steps/registry.d.ts +88 -0
  207. package/dist/src/yaml/steps/registry.d.ts.map +1 -0
  208. package/dist/src/yaml/steps/registry.js +125 -0
  209. package/dist/src/yaml/steps/registry.test.d.ts +5 -0
  210. package/dist/src/yaml/steps/registry.test.d.ts.map +1 -0
  211. package/dist/src/yaml/steps/registry.test.js +235 -0
  212. package/dist/src/yaml/steps/release.d.ts +50 -0
  213. package/dist/src/yaml/steps/release.d.ts.map +1 -0
  214. package/dist/src/yaml/steps/release.js +154 -0
  215. package/dist/src/yaml/steps/script.d.ts +23 -0
  216. package/dist/src/yaml/steps/script.d.ts.map +1 -0
  217. package/dist/src/yaml/steps/script.js +63 -0
  218. package/dist/src/yaml/steps/spec-validation.test.d.ts +6 -0
  219. package/dist/src/yaml/steps/spec-validation.test.d.ts.map +1 -0
  220. package/dist/src/yaml/steps/spec-validation.test.js +130 -0
  221. package/dist/src/yaml/steps/steps.test.d.ts +6 -0
  222. package/dist/src/yaml/steps/steps.test.d.ts.map +1 -0
  223. package/dist/src/yaml/steps/steps.test.js +474 -0
  224. package/dist/src/yaml/steps/test-config.d.ts +3 -0
  225. package/dist/src/yaml/steps/test-config.d.ts.map +1 -0
  226. package/dist/src/yaml/steps/test-config.js +16 -0
  227. package/dist/src/yaml/steps/xcode-new.test.d.ts +5 -0
  228. package/dist/src/yaml/steps/xcode-new.test.d.ts.map +1 -0
  229. package/dist/src/yaml/steps/xcode-new.test.js +211 -0
  230. package/dist/src/yaml/steps/xcode.d.ts +222 -0
  231. package/dist/src/yaml/steps/xcode.d.ts.map +1 -0
  232. package/dist/src/yaml/steps/xcode.js +999 -0
  233. package/dist/src/yaml/types.d.ts +68 -0
  234. package/dist/src/yaml/types.d.ts.map +1 -0
  235. package/dist/src/yaml/types.js +5 -0
  236. package/dist/src/yaml/validation-types.d.ts +96 -0
  237. package/dist/src/yaml/validation-types.d.ts.map +1 -0
  238. package/dist/src/yaml/validation-types.js +8 -0
  239. package/dist/src/yaml/yaml-updater.d.ts +24 -0
  240. package/dist/src/yaml/yaml-updater.d.ts.map +1 -0
  241. package/dist/src/yaml/yaml-updater.js +128 -0
  242. package/package.json +16 -4
@@ -0,0 +1,474 @@
1
+ /**
2
+ * Integration tests for step implementations
3
+ * Tests each step executor with sample inputs
4
+ */
5
+ import { describe, test, expect } from '@jest/globals';
6
+ import { GitCloneStepExecutor } from './git-clone.js';
7
+ import { ScriptStepExecutor } from './script.js';
8
+ import { CachePullStepExecutor, CachePushStepExecutor } from './cache.js';
9
+ import { testConfig } from './test-config.js';
10
+ import { XcodeBuildStepExecutor, XcodeTestStepExecutor } from './xcode.js';
11
+ import { SetJavaVersionStepExecutor, GradleBuildStepExecutor, AndroidLintStepExecutor, AndroidUnitTestStepExecutor, } from './android.js';
12
+ describe('Step Implementations', () => {
13
+ describe('GitCloneStepExecutor', () => {
14
+ test('should generate local checkout script', async () => {
15
+ const executor = new GitCloneStepExecutor();
16
+ const result = await executor.execute({}, {}, testConfig);
17
+ expect(result.kind).toBe('script');
18
+ expect(result.name).toBe('git-clone');
19
+ expect(result.script).toContain('git rev-parse --show-toplevel');
20
+ expect(result.script).toContain('CIBUILD_SOURCE_DIR');
21
+ expect(result.script).toContain('COMMIT_HASH');
22
+ });
23
+ test('should export commit metadata via envman', async () => {
24
+ const executor = new GitCloneStepExecutor();
25
+ const result = await executor.execute({}, {}, testConfig);
26
+ expect(result.script).toContain('envman add --key CIBUILD_SOURCE_DIR');
27
+ expect(result.script).toContain('envman add --key GIT_CLONE_COMMIT_HASH');
28
+ expect(result.script).toContain('envman add --key CIBUILD_GIT_COMMIT');
29
+ expect(result.script).toContain('envman add --key GIT_CLONE_COMMIT_AUTHOR_NAME');
30
+ expect(result.script).toContain('envman add --key GIT_CLONE_COMMIT_MESSAGE_SUBJECT');
31
+ });
32
+ test('should export CIBUILD variables', async () => {
33
+ const executor = new GitCloneStepExecutor();
34
+ const result = await executor.execute({}, {}, testConfig);
35
+ expect(result.script).toContain('envman add --key CIBUILD_SOURCE_DIR');
36
+ expect(result.script).toContain('envman add --key CIBUILD_GIT_COMMIT');
37
+ });
38
+ test('should fail if not in a git repository', async () => {
39
+ const executor = new GitCloneStepExecutor();
40
+ const result = await executor.execute({}, {}, testConfig);
41
+ expect(result.script).toContain('Not inside a git repository');
42
+ expect(result.script).toContain('exit 1');
43
+ });
44
+ });
45
+ describe('ScriptStepExecutor', () => {
46
+ test('should generate bash script', async () => {
47
+ const executor = new ScriptStepExecutor();
48
+ const inputs = {
49
+ content: 'echo "Hello World"',
50
+ };
51
+ const result = await executor.execute(inputs, {}, testConfig);
52
+ expect(result.kind).toBe('script');
53
+ expect(result.name).toBe('script');
54
+ expect(result.script).toContain('echo "Hello World"');
55
+ });
56
+ test('should require content input', async () => {
57
+ const executor = new ScriptStepExecutor();
58
+ const inputs = {};
59
+ await expect(executor.execute(inputs, {}, testConfig)).rejects.toThrow("Missing required input 'content'");
60
+ });
61
+ test('should support working directory', async () => {
62
+ const executor = new ScriptStepExecutor();
63
+ const inputs = {
64
+ content: 'pwd',
65
+ working_dir: '/tmp/test',
66
+ };
67
+ const result = await executor.execute(inputs, {}, testConfig);
68
+ expect(result.script).toContain('cd');
69
+ expect(result.script).toContain('/tmp/test');
70
+ });
71
+ test('should support python runner', async () => {
72
+ const executor = new ScriptStepExecutor();
73
+ const inputs = {
74
+ content: 'print("Hello from Python")',
75
+ runner_bin: 'python3',
76
+ };
77
+ const result = await executor.execute(inputs, {}, testConfig);
78
+ expect(result.kind).toBe('python');
79
+ expect(result.script).toBe('print("Hello from Python")');
80
+ });
81
+ test('should support node runner', async () => {
82
+ const executor = new ScriptStepExecutor();
83
+ const inputs = {
84
+ content: 'console.log("Hello from Node")',
85
+ runner_bin: 'node',
86
+ };
87
+ const result = await executor.execute(inputs, {}, testConfig);
88
+ expect(result.kind).toBe('node');
89
+ expect(result.script).toBe('console.log("Hello from Node")');
90
+ });
91
+ test('should support ruby runner', async () => {
92
+ const executor = new ScriptStepExecutor();
93
+ const inputs = {
94
+ content: 'puts "Hello from Ruby"',
95
+ runner_bin: 'ruby',
96
+ };
97
+ const result = await executor.execute(inputs, {}, testConfig);
98
+ expect(result.kind).toBe('ruby');
99
+ expect(result.script).toBe('puts "Hello from Ruby"');
100
+ });
101
+ });
102
+ describe('CachePullStepExecutor', () => {
103
+ test('should generate cache pull script', async () => {
104
+ const executor = new CachePullStepExecutor();
105
+ const inputs = {
106
+ cache_key: 'node-modules-v1',
107
+ cache_paths: ['node_modules'],
108
+ };
109
+ const result = await executor.execute(inputs, {}, testConfig);
110
+ expect(result.kind).toBe('script');
111
+ expect(result.name).toBe('cache-pull');
112
+ expect(result.script).toContain('cache-pull');
113
+ expect(result.script).toContain('node-modules-v1');
114
+ expect(result.script).toContain('.ci-cache');
115
+ });
116
+ test('should skip gracefully when cache_key is missing', async () => {
117
+ const executor = new CachePullStepExecutor();
118
+ const inputs = {};
119
+ const result = await executor.execute(inputs, {}, testConfig);
120
+ expect(result.script).toContain('skipped');
121
+ });
122
+ test('should support debug mode', async () => {
123
+ const executor = new CachePullStepExecutor();
124
+ const inputs = {
125
+ cache_key: 'test-cache',
126
+ is_debug_mode: true,
127
+ };
128
+ const result = await executor.execute(inputs, {}, testConfig);
129
+ expect(result.script).toContain('Debug mode enabled');
130
+ });
131
+ test('should auto-configure for cocoapods technology', async () => {
132
+ const executor = new CachePullStepExecutor();
133
+ const result = await executor.execute({ technology: 'cocoapods' }, {}, testConfig);
134
+ expect(result.script).toContain('Podfile.lock');
135
+ expect(result.script).toContain('pods-');
136
+ expect(result.script).toContain('shasum -a 256');
137
+ });
138
+ test('should auto-configure for gradle technology', async () => {
139
+ const executor = new CachePullStepExecutor();
140
+ const result = await executor.execute({ technology: 'gradle' }, {}, testConfig);
141
+ expect(result.script).toContain('gradle/wrapper/gradle-wrapper.properties');
142
+ expect(result.script).toContain('gradle-');
143
+ });
144
+ test('should auto-configure for npm technology', async () => {
145
+ const executor = new CachePullStepExecutor();
146
+ const result = await executor.execute({ technology: 'npm' }, {}, testConfig);
147
+ expect(result.script).toContain('package-lock.json');
148
+ expect(result.script).toContain('npm-');
149
+ });
150
+ test('should auto-configure for dart technology', async () => {
151
+ const executor = new CachePullStepExecutor();
152
+ const result = await executor.execute({ technology: 'dart' }, {}, testConfig);
153
+ expect(result.script).toContain('pubspec.lock');
154
+ expect(result.script).toContain('dart-');
155
+ });
156
+ test('should auto-configure for carthage technology', async () => {
157
+ const executor = new CachePullStepExecutor();
158
+ const result = await executor.execute({ technology: 'carthage' }, {}, testConfig);
159
+ expect(result.script).toContain('Cartfile.resolved');
160
+ expect(result.script).toContain('carthage-');
161
+ });
162
+ test('should auto-configure for spm technology', async () => {
163
+ const executor = new CachePullStepExecutor();
164
+ const result = await executor.execute({ technology: 'spm' }, {}, testConfig);
165
+ expect(result.script).toContain('Package.resolved');
166
+ expect(result.script).toContain('spm-');
167
+ });
168
+ test('should auto-configure for yarn technology', async () => {
169
+ const executor = new CachePullStepExecutor();
170
+ const result = await executor.execute({ technology: 'yarn' }, {}, testConfig);
171
+ expect(result.script).toContain('yarn.lock');
172
+ expect(result.script).toContain('yarn-');
173
+ });
174
+ test('should throw on unknown technology', async () => {
175
+ const executor = new CachePullStepExecutor();
176
+ await expect(executor.execute({ technology: 'unknown' }, {}, testConfig)).rejects.toThrow("Unknown cache technology 'unknown'");
177
+ });
178
+ });
179
+ describe('CachePushStepExecutor', () => {
180
+ test('should generate cache push script', async () => {
181
+ const executor = new CachePushStepExecutor();
182
+ const inputs = {
183
+ cache_key: 'node-modules-v1',
184
+ cache_paths: ['node_modules', '.gradle'],
185
+ };
186
+ const result = await executor.execute(inputs, {}, testConfig);
187
+ expect(result.kind).toBe('script');
188
+ expect(result.name).toBe('cache-push');
189
+ expect(result.script).toContain('cache-push');
190
+ expect(result.script).toContain('node-modules-v1');
191
+ expect(result.script).toContain('.ci-cache');
192
+ });
193
+ test('should skip gracefully when cache_key is missing', async () => {
194
+ const executor = new CachePushStepExecutor();
195
+ const inputs = {
196
+ cache_paths: ['node_modules'],
197
+ };
198
+ const result = await executor.execute(inputs, {}, testConfig);
199
+ expect(result.script).toContain('skipped');
200
+ });
201
+ test('should require cache_paths', async () => {
202
+ const executor = new CachePushStepExecutor();
203
+ const inputs = {
204
+ cache_key: 'test-cache',
205
+ cache_paths: [],
206
+ };
207
+ await expect(executor.execute(inputs, {}, testConfig)).rejects.toThrow("Missing or empty 'cache_paths'");
208
+ });
209
+ test('should support debug mode', async () => {
210
+ const executor = new CachePushStepExecutor();
211
+ const inputs = {
212
+ cache_key: 'test-cache',
213
+ cache_paths: ['build'],
214
+ is_debug_mode: true,
215
+ };
216
+ const result = await executor.execute(inputs, {}, testConfig);
217
+ expect(result.script).toContain('Debug mode enabled');
218
+ });
219
+ test('should auto-configure for cocoapods technology', async () => {
220
+ const executor = new CachePushStepExecutor();
221
+ const result = await executor.execute({ technology: 'cocoapods' }, {}, testConfig);
222
+ expect(result.script).toContain('Podfile.lock');
223
+ expect(result.script).toContain('pods-');
224
+ expect(result.script).toContain('Pods');
225
+ expect(result.script).toContain('tar -czf');
226
+ });
227
+ test('should auto-configure for gradle technology', async () => {
228
+ const executor = new CachePushStepExecutor();
229
+ const result = await executor.execute({ technology: 'gradle' }, {}, testConfig);
230
+ expect(result.script).toContain('gradle/wrapper/gradle-wrapper.properties');
231
+ expect(result.script).toContain('~/.gradle/caches');
232
+ });
233
+ test('should auto-configure for npm technology', async () => {
234
+ const executor = new CachePushStepExecutor();
235
+ const result = await executor.execute({ technology: 'npm' }, {}, testConfig);
236
+ expect(result.script).toContain('package-lock.json');
237
+ expect(result.script).toContain('node_modules');
238
+ });
239
+ test('should auto-configure for dart technology', async () => {
240
+ const executor = new CachePushStepExecutor();
241
+ const result = await executor.execute({ technology: 'dart' }, {}, testConfig);
242
+ expect(result.script).toContain('pubspec.lock');
243
+ expect(result.script).toContain('.dart_tool');
244
+ expect(result.script).toContain('.pub-cache');
245
+ });
246
+ test('should throw on unknown technology', async () => {
247
+ const executor = new CachePushStepExecutor();
248
+ await expect(executor.execute({ technology: 'unknown' }, {}, testConfig)).rejects.toThrow("Unknown cache technology 'unknown'");
249
+ });
250
+ });
251
+ describe('XcodeBuildStepExecutor', () => {
252
+ test('should generate xcodebuild script', async () => {
253
+ const executor = new XcodeBuildStepExecutor();
254
+ const inputs = {
255
+ project_path: 'MyApp.xcodeproj',
256
+ scheme: 'MyApp',
257
+ configuration: 'Release',
258
+ };
259
+ const result = await executor.execute(inputs, {}, testConfig);
260
+ expect(result.kind).toBe('script');
261
+ expect(result.name).toBe('xcodebuild');
262
+ expect(result.script).toContain('xcodebuild');
263
+ expect(result.script).toContain('MyApp.xcodeproj');
264
+ expect(result.script).toContain('-scheme');
265
+ expect(result.script).toContain('MyApp');
266
+ expect(result.script).toContain('-configuration');
267
+ expect(result.script).toContain('Release');
268
+ });
269
+ test('should require project_path', async () => {
270
+ const executor = new XcodeBuildStepExecutor();
271
+ const inputs = {
272
+ scheme: 'MyApp',
273
+ };
274
+ await expect(executor.execute(inputs, {}, testConfig)).rejects.toThrow("Missing required input 'project_path'");
275
+ });
276
+ test('should require scheme', async () => {
277
+ const executor = new XcodeBuildStepExecutor();
278
+ const inputs = {
279
+ project_path: 'MyApp.xcodeproj',
280
+ };
281
+ await expect(executor.execute(inputs, {}, testConfig)).rejects.toThrow("Missing required input 'scheme'");
282
+ });
283
+ test('should support workspace files', async () => {
284
+ const executor = new XcodeBuildStepExecutor();
285
+ const inputs = {
286
+ project_path: 'MyApp.xcworkspace',
287
+ scheme: 'MyApp',
288
+ };
289
+ const result = await executor.execute(inputs, {}, testConfig);
290
+ expect(result.script).toContain('xcworkspace');
291
+ });
292
+ test('should support clean build', async () => {
293
+ const executor = new XcodeBuildStepExecutor();
294
+ const inputs = {
295
+ project_path: 'MyApp.xcodeproj',
296
+ scheme: 'MyApp',
297
+ is_clean_build: true,
298
+ };
299
+ const result = await executor.execute(inputs, {}, testConfig);
300
+ expect(result.script).toContain('clean');
301
+ });
302
+ });
303
+ describe('XcodeTestStepExecutor', () => {
304
+ test('should generate xcode test script', async () => {
305
+ const executor = new XcodeTestStepExecutor();
306
+ const inputs = {
307
+ project_path: 'MyApp.xcodeproj',
308
+ scheme: 'MyApp',
309
+ };
310
+ const result = await executor.execute(inputs, {}, testConfig);
311
+ expect(result.kind).toBe('script');
312
+ expect(result.name).toBe('xcode-test');
313
+ expect(result.script).toContain('xcodebuild test');
314
+ expect(result.script).toContain('MyApp.xcodeproj');
315
+ });
316
+ test('should support code coverage', async () => {
317
+ const executor = new XcodeTestStepExecutor();
318
+ const inputs = {
319
+ project_path: 'MyApp.xcodeproj',
320
+ scheme: 'MyApp',
321
+ is_code_coverage_enabled: true,
322
+ };
323
+ const result = await executor.execute(inputs, {}, testConfig);
324
+ expect(result.script).toContain('enableCodeCoverage YES');
325
+ });
326
+ test('should support test plan', async () => {
327
+ const executor = new XcodeTestStepExecutor();
328
+ const inputs = {
329
+ project_path: 'MyApp.xcodeproj',
330
+ scheme: 'MyApp',
331
+ test_plan: 'MyTestPlan',
332
+ };
333
+ const result = await executor.execute(inputs, {}, testConfig);
334
+ expect(result.script).toContain('-testPlan');
335
+ expect(result.script).toContain('MyTestPlan');
336
+ });
337
+ });
338
+ describe('SetJavaVersionStepExecutor', () => {
339
+ test('should generate java version script', async () => {
340
+ const executor = new SetJavaVersionStepExecutor();
341
+ const inputs = {
342
+ java_version: '17',
343
+ };
344
+ const result = await executor.execute(inputs, {}, testConfig);
345
+ expect(result.kind).toBe('script');
346
+ expect(result.name).toBe('set-java-version');
347
+ expect(result.script).toContain('JAVA_HOME');
348
+ expect(result.script).toContain('17');
349
+ });
350
+ test('should default to Java 17', async () => {
351
+ const executor = new SetJavaVersionStepExecutor();
352
+ const inputs = {};
353
+ const result = await executor.execute(inputs, {}, testConfig);
354
+ expect(result.script).toContain('17');
355
+ });
356
+ test('should support different Java versions', async () => {
357
+ const executor = new SetJavaVersionStepExecutor();
358
+ const inputs = {
359
+ java_version: '11',
360
+ };
361
+ const result = await executor.execute(inputs, {}, testConfig);
362
+ expect(result.script).toContain('11');
363
+ });
364
+ });
365
+ describe('GradleBuildStepExecutor', () => {
366
+ test('should generate gradle build script', async () => {
367
+ const executor = new GradleBuildStepExecutor();
368
+ const inputs = {
369
+ project_location: '.',
370
+ build_type: 'Release',
371
+ };
372
+ const result = await executor.execute(inputs, {}, testConfig);
373
+ expect(result.kind).toBe('script');
374
+ expect(result.name).toBe('gradle-build');
375
+ expect(result.script).toContain('Gradle Build');
376
+ expect(result.script).toContain('assembleRelease');
377
+ });
378
+ test('should support debug build', async () => {
379
+ const executor = new GradleBuildStepExecutor();
380
+ const inputs = {
381
+ build_type: 'Debug',
382
+ };
383
+ const result = await executor.execute(inputs, {}, testConfig);
384
+ expect(result.script).toContain('assembleDebug');
385
+ });
386
+ test('should support custom gradle task', async () => {
387
+ const executor = new GradleBuildStepExecutor();
388
+ const inputs = {
389
+ gradle_task: 'bundleRelease',
390
+ };
391
+ const result = await executor.execute(inputs, {}, testConfig);
392
+ expect(result.script).toContain('bundleRelease');
393
+ });
394
+ test('should support custom project location', async () => {
395
+ const executor = new GradleBuildStepExecutor();
396
+ const inputs = {
397
+ project_location: 'android',
398
+ };
399
+ const result = await executor.execute(inputs, {}, testConfig);
400
+ expect(result.script).toContain('cd');
401
+ expect(result.script).toContain('android');
402
+ });
403
+ test('should support gradle options', async () => {
404
+ const executor = new GradleBuildStepExecutor();
405
+ const inputs = {
406
+ gradle_options: '--stacktrace --no-daemon',
407
+ };
408
+ const result = await executor.execute(inputs, {}, testConfig);
409
+ expect(result.script).toContain('--stacktrace --no-daemon');
410
+ });
411
+ });
412
+ describe('AndroidLintStepExecutor', () => {
413
+ test('should generate lint script', async () => {
414
+ const executor = new AndroidLintStepExecutor();
415
+ const inputs = {
416
+ module: 'app',
417
+ variant: 'debug',
418
+ };
419
+ const result = await executor.execute(inputs, {}, testConfig);
420
+ expect(result.kind).toBe('script');
421
+ expect(result.name).toBe('android-lint');
422
+ expect(result.script).toContain('lint');
423
+ expect(result.script).toContain(':app:lintDebug');
424
+ });
425
+ test('should support custom module', async () => {
426
+ const executor = new AndroidLintStepExecutor();
427
+ const inputs = {
428
+ module: 'library',
429
+ };
430
+ const result = await executor.execute(inputs, {}, testConfig);
431
+ expect(result.script).toContain(':library:');
432
+ });
433
+ test('should capitalize variant correctly', async () => {
434
+ const executor = new AndroidLintStepExecutor();
435
+ const inputs = {
436
+ variant: 'release',
437
+ };
438
+ const result = await executor.execute(inputs, {}, testConfig);
439
+ expect(result.script).toContain('lintRelease');
440
+ });
441
+ });
442
+ describe('AndroidUnitTestStepExecutor', () => {
443
+ test('should generate unit test script', async () => {
444
+ const executor = new AndroidUnitTestStepExecutor();
445
+ const inputs = {
446
+ module: 'app',
447
+ variant: 'debug',
448
+ };
449
+ const result = await executor.execute(inputs, {}, testConfig);
450
+ expect(result.kind).toBe('script');
451
+ expect(result.name).toBe('android-unit-test');
452
+ expect(result.script).toContain('test');
453
+ expect(result.script).toContain(':app:testDebugUnitTest');
454
+ });
455
+ test('should support test filter', async () => {
456
+ const executor = new AndroidUnitTestStepExecutor();
457
+ const inputs = {
458
+ test_filter: 'com.example.MyTest',
459
+ };
460
+ const result = await executor.execute(inputs, {}, testConfig);
461
+ expect(result.script).toContain('--tests');
462
+ expect(result.script).toContain('com.example.MyTest');
463
+ });
464
+ test('should support custom variant', async () => {
465
+ const executor = new AndroidUnitTestStepExecutor();
466
+ const inputs = {
467
+ variant: 'staging',
468
+ };
469
+ const result = await executor.execute(inputs, {}, testConfig);
470
+ expect(result.script).toContain('testStagingUnitTest');
471
+ });
472
+ });
473
+ });
474
+ //# sourceMappingURL=steps.test.js.map
@@ -0,0 +1,3 @@
1
+ import type { CIConfig } from '../../types.js';
2
+ export declare const testConfig: CIConfig;
3
+ //# sourceMappingURL=test-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-config.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/test-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,eAAO,MAAM,UAAU,EAAE,QAcxB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export const testConfig = {
2
+ artifactsDir: './artifacts',
3
+ interpreters: {
4
+ python: 'python3',
5
+ ruby: 'ruby',
6
+ node: 'node',
7
+ bash: '/bin/bash',
8
+ },
9
+ maxConcurrentJobs: 1,
10
+ paths: {
11
+ buildsDir: '.ci-builds',
12
+ cacheDir: '.ci-cache',
13
+ derivedDataDir: '~/Library/Developer/Xcode/DerivedData',
14
+ },
15
+ };
16
+ //# sourceMappingURL=test-config.js.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Tests for new Xcode steps: xcode-build-for-test, xcode-test-without-building, xcode-build-for-simulator
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=xcode-new.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xcode-new.test.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/xcode-new.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}