This repository was archived by the owner on Jan 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathci.cue
More file actions
67 lines (58 loc) · 1.19 KB
/
ci.cue
File metadata and controls
67 lines (58 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package ci
import (
"dagger.io/dagger"
"universe.dagger.io/go"
"universe.dagger.io/alpha/go/golangci"
)
dagger.#Plan & {
// Input
client: filesystem: ".": read: {
include: ["**/*.go", "go.mod", "go.sum", ".golangci.yaml", "**/testdata/*", ".golangci.yaml"]
}
// Output
client: filesystem: {
"/tmp/cov.html": write: {
contents: actions.test.coverage.export.files."/tmp/cov.html"
}
"/tmp/cov.txt": write: {
contents: actions.test.coverage.export.files."/tmp/cov.txt"
}
"./bin": write: {
contents: actions.build.output
}
}
actions: {
_code: client.filesystem.".".read.contents
build: go.#Build & {
source: _code
package: "github.com/dagger/cuelsp/cmd/cuelsp"
}
test: {
go.#Test & {
source: _code
package: "./..."
command: flags: {
"-race": true
"-coverprofile": "/tmp/cov.txt"
}
}
coverage: go.#Container & {
image: test.output
source: _code
command: {
name: "sh"
args: ["-c", """
go tool cover -html=/tmp/cov.txt -o /tmp/cov.html
"""]
}
export: files: {
"/tmp/cov.html": string
"/tmp/cov.txt": string
}
}
}
lint: golangci.#Lint & {
source: _code
}
}
}