MCPcopy Create free account
hub / github.com/github/gh-aw / TestCompileToYAML_BasicCompilation

Function TestCompileToYAML_BasicCompilation

pkg/workflow/compiler_string_api_test.go:190–219  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

188}
189
190func TestCompileToYAML_BasicCompilation(t *testing.T) {
191 markdown := `---
192name: compile-test
193on:
194 workflow_dispatch:
195engine: copilot
196---
197
198# Mission
199
200Greet the user warmly.
201`
202
203 compiler := NewCompiler(
204 WithNoEmit(true),
205 WithSkipValidation(true),
206 )
207
208 wd, err := compiler.ParseWorkflowString(markdown, "workflow.md")
209 require.NoError(t, err)
210
211 yaml, err := compiler.CompileToYAML(wd, "workflow.md")
212 require.NoError(t, err)
213 assert.NotEmpty(t, yaml)
214
215 // The generated YAML should contain standard GitHub Actions structure
216 assert.Contains(t, yaml, "name:")
217 assert.Contains(t, yaml, "on:")
218 assert.Contains(t, yaml, "jobs:")
219}
220
221func TestCompileToYAML_OutputContainsWorkflowName(t *testing.T) {
222 markdown := `---

Callers

nothing calls this directly

Calls 5

ParseWorkflowStringMethod · 0.95
CompileToYAMLMethod · 0.95
NewCompilerFunction · 0.85
WithNoEmitFunction · 0.85
WithSkipValidationFunction · 0.85

Tested by

no test coverage detected