ci: cleaner pattern for sharing base images across actions

Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
This commit is contained in:
Sam Alba
2022-02-17 11:58:31 -08:00
parent f17c470feb
commit 8e2f3eb21d
2 changed files with 11 additions and 7 deletions

View File

@@ -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"