generateCacheSteps generates cache steps for the workflow based on cache configuration
(builder *strings.Builder, data *WorkflowData, verbose bool)
| 367 | |
| 368 | // generateCacheSteps generates cache steps for the workflow based on cache configuration |
| 369 | func generateCacheSteps(builder *strings.Builder, data *WorkflowData, verbose bool) { |
| 370 | if data.Cache == "" { |
| 371 | return |
| 372 | } |
| 373 | |
| 374 | cacheLog.Print("Generating cache steps from frontmatter cache configuration") |
| 375 | builder.WriteString(" # Cache configuration from frontmatter processed below\n") |
| 376 | caches, err := parseCacheStepConfigs(data.Cache) |
| 377 | if err != nil { |
| 378 | if verbose { |
| 379 | fmt.Fprintf(os.Stderr, "Warning: Failed to parse cache configuration: %v\n", err) |
| 380 | } |
| 381 | return |
| 382 | } |
| 383 | for i, cache := range caches { |
| 384 | writeCacheStep(builder, cache, i, len(caches)) |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | func parseCacheStepConfigs(cacheYAML string) ([]map[string]any, error) { |
| 389 | var topLevel map[string]any |
no test coverage detected