2d3acc61e0
Signed-off-by: Vasek - Tom C <tom.chauveau@epitech.eu>
35 lines
592 B
CUE
35 lines
592 B
CUE
package main
|
|
|
|
import (
|
|
"dagger.io/dagger"
|
|
"universe.dagger.io/go"
|
|
)
|
|
|
|
dagger.#Plan & {
|
|
client: {
|
|
// Retrieve go source code
|
|
filesystem: ".": read: {
|
|
contents: dagger.#FS
|
|
include: ["go.mod", "go.sum", "**/*.go"]
|
|
}
|
|
}
|
|
|
|
actions: {
|
|
// Alias to code directory
|
|
_code: client.filesystem.".".read.contents
|
|
|
|
// Improved go base image with useful tool
|
|
// Enable cgo by installing build-base
|
|
_base: go.#Image & {
|
|
packages: "build-base": version: _
|
|
}
|
|
|
|
// Run go unit test
|
|
"unit-test": go.#Test & {
|
|
source: _code
|
|
package: "./..."
|
|
input: _base.output
|
|
}
|
|
}
|
|
}
|