ci: cleaner pattern for sharing base images across actions
Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
This commit is contained in:
10
ci/main.cue
10
ci/main.cue
@@ -24,8 +24,8 @@ engine.#Plan & {
|
||||
}
|
||||
|
||||
outputs: directories: "go binaries": {
|
||||
contents: actions.build.export.directories["/build"].contents
|
||||
dest: "./build"
|
||||
contents: actions.build.export.directories["/build"].contents
|
||||
dest: "./build"
|
||||
}
|
||||
|
||||
actions: {
|
||||
@@ -33,6 +33,8 @@ engine.#Plan & {
|
||||
id: "go mod cache"
|
||||
}
|
||||
|
||||
baseImages: #Images
|
||||
|
||||
source: "dagger source code": {
|
||||
contents: inputs.directories.source.contents
|
||||
dest: "/usr/src/dagger"
|
||||
@@ -40,7 +42,7 @@ engine.#Plan & {
|
||||
|
||||
// FIXME: build only if the linter passed
|
||||
build: bash.#Run & {
|
||||
input: images.goBuilder.output
|
||||
input: baseImages.goBuilder
|
||||
|
||||
env: {
|
||||
GOMODCACHE: mounts["go mod cache"].dest
|
||||
@@ -71,7 +73,7 @@ engine.#Plan & {
|
||||
}
|
||||
|
||||
goLint: bash.#Run & {
|
||||
input: images.goLinter.output
|
||||
input: baseImages.goLinter
|
||||
|
||||
// FIXME: the source volume is too slow, taking >3m on docker for mac (vs < 2sec on the host machine)
|
||||
script: contents: "golangci-lint run -v --timeout 5m"
|
||||
|
Reference in New Issue
Block a user