()
| 16 | } |
| 17 | |
| 18 | public async executeAsync(): Promise<void> { |
| 19 | let maybeError: Error | null = null; |
| 20 | for (const step of this.buildSteps) { |
| 21 | let shouldExecuteStep = false; |
| 22 | |
| 23 | try { |
| 24 | shouldExecuteStep = step.shouldExecuteStep(); |
| 25 | } catch (err: any) { |
| 26 | step.ctx.logger.error({ err }); |
| 27 | step.ctx.logger.error( |
| 28 | `Runner failed to evaluate if it should execute step "${step.displayName}", using step's if condition "${step.ifCondition}". This can be caused by trying to access non-existing object property. If you think this is a bug report it here: https://github.com/expo/eas-cli/issues.` |
| 29 | ); |
| 30 | maybeError = maybeError ?? err; |
| 31 | this.ctx.markAsFailed(); |
| 32 | } |
| 33 | |
| 34 | if (shouldExecuteStep) { |
| 35 | const startTime = performance.now(); |
| 36 | let stepResult: StepMetricResult; |
| 37 | try { |
| 38 | await step.executeAsync(); |
| 39 | stepResult = 'success'; |
| 40 | } catch (err: any) { |
| 41 | stepResult = 'failed'; |
| 42 | maybeError = maybeError ?? err; |
| 43 | this.ctx.markAsFailed(); |
| 44 | } finally { |
| 45 | this.collectStepMetrics(step, stepResult!, performance.now() - startTime); |
| 46 | } |
| 47 | } else { |
| 48 | step.skip(); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | if (maybeError) { |
| 53 | throw maybeError; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | private collectStepMetrics(step: BuildStep, result: StepMetricResult, durationMs: number): void { |
| 58 | if (!step.__metricsId) { |
nothing calls this directly
no test coverage detected