(t *testing.T)
| 109 | } |
| 110 | |
| 111 | func TestReadWorkflow_StringContainer(t *testing.T) { |
| 112 | yaml := ` |
| 113 | name: local-action-docker-url |
| 114 | |
| 115 | jobs: |
| 116 | test: |
| 117 | container: nginx:latest |
| 118 | runs-on: ubuntu-latest |
| 119 | steps: |
| 120 | - uses: ./actions/docker-url |
| 121 | test2: |
| 122 | container: |
| 123 | image: nginx:latest |
| 124 | env: |
| 125 | foo: bar |
| 126 | runs-on: ubuntu-latest |
| 127 | steps: |
| 128 | - uses: ./actions/docker-url |
| 129 | ` |
| 130 | |
| 131 | workflow, err := ReadWorkflow(strings.NewReader(yaml), false) |
| 132 | assert.NoError(t, err, "read workflow should succeed") |
| 133 | assert.Len(t, workflow.Jobs, 2) |
| 134 | assert.Contains(t, workflow.Jobs["test"].Container().Image, "nginx:latest") |
| 135 | assert.Contains(t, workflow.Jobs["test2"].Container().Image, "nginx:latest") |
| 136 | assert.Contains(t, workflow.Jobs["test2"].Container().Env["foo"], "bar") |
| 137 | } |
| 138 | |
| 139 | func TestReadWorkflow_ObjectContainer(t *testing.T) { |
| 140 | yaml := ` |
nothing calls this directly
no test coverage detected
searching dependent graphs…