diff --git a/pipeline.libsonnet b/pipeline.libsonnet index 4d724f1..c6b23e8 100644 --- a/pipeline.libsonnet +++ b/pipeline.libsonnet @@ -9,7 +9,9 @@ local golang_image(os, version) = { test(os='linux', arch='amd64', version=''):: + local is_windows = windows(os); local golang = golang_image(os, version); + local volumes = if !is_windows then [{name: 'gopath', path: '/go',}]; { kind: 'pipeline', name: test_pipeline_name, @@ -29,6 +31,7 @@ local golang_image(os, version) = commands: [ 'go vet ./...', ], + volumes: if std.length(volumes) > 0 then volumes, }, { name: 'test', @@ -40,8 +43,10 @@ local golang_image(os, version) = commands: [ 'go test -cover ./...', ], + volumes: if std.length(volumes) > 0 then volumes, }, ], + volumes: if !is_windows then [{name: 'gopath', temp: {}}] }, build(name, os='linux', arch='amd64', version='')::