This repository was archived by the owner on Aug 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci.cue
More file actions
80 lines (66 loc) · 1.61 KB
/
ci.cue
File metadata and controls
80 lines (66 loc) · 1.61 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
68
69
70
71
72
73
74
75
76
77
78
79
80
package main
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/bash"
"universe.dagger.io/alpine"
"universe.dagger.io/go"
"github.com/mockingio/dagger/ci/golangci"
)
dagger.#Plan & {
client: filesystem: ".": read: contents: dagger.#FS
client: filesystem: "./bin": write: contents: actions.build."go".output
actions: {
_source: client.filesystem.".".read.contents
test: {
unit: go.#Test & {
source: _source
package: "./..."
command: flags: "-race": true
}
}
lint: {
go: golangci.#Lint & {
source: _source
version: "1.45"
}
}
version: {
_image: alpine.#Build & {
packages: bash: _
packages: curl: _
packages: git: _
}
_revision: bash.#Run & {
input: _image.output
workdir: "/src"
mounts: source: {
dest: "/src"
contents: _source
}
script: contents: #"""
printf "$(git rev-parse --short HEAD)" > /revision
"""#
export: files: "/revision": string
}
output: _revision.export.files["/revision"]
}
build: {
"go": go.#Build & {
source: client.filesystem.".".read.contents
env: {
CGO_ENABLED: "0"
}
package: "."
os: *client.platform.os | "linux"
arch: client.platform.arch
ldflags: "-s -w -X github.com/mockingio/mockingio/cmd/version.Revision=\(version.output)"
env: depends_unit: "\(test.unit.exit)"
}
docker: core.#Dockerfile & {
source: _source
dockerfile: path: "Dockerfile"
}
}
}
}