File tree 6 files changed +55
-85
lines changed
6 files changed +55
-85
lines changed Original file line number Diff line number Diff line change 42
42
go build -o build/docgen ./cmd/docgen
43
43
go build -o build/builtingen ./cmd/builtingen
44
44
45
- - name : Go Tests
46
- run : go test -v ./...
47
-
48
45
- name : Start BuildkitD
49
46
if : github.repository != 'openllb/hlb'
50
47
run : docker run --name buildkitd --rm -d --privileged openllb/buildkit:experimental
54
51
# waiting for buildkitd to report 1 worker (2 lines, 1 for column titles, one for the worker details)
55
52
run : while true; do lineCount=$(docker exec buildkitd buildctl debug workers | wc -l); if [ $lineCount -gt 1 ]; then break; fi; sleep 1; done
56
53
54
+ - name : Go Tests
55
+ run : ./build/hlb run -t test
56
+
57
57
- name : GoLint
58
58
run : ./build/hlb run -t lint
59
59
Original file line number Diff line number Diff line change @@ -17,6 +17,5 @@ linters:
17
17
- unparam
18
18
- varcheck
19
19
20
-
21
20
issues :
22
21
exclude-use-default : false
Original file line number Diff line number Diff line change 1
- # TODO replace with openllb/go.hlb
2
- import go "./go.hlb"
1
+ import go from fs {
2
+ image "openllb/go.hlb"
3
+ }
4
+
3
5
import mkdocs "./mkdocs.hlb"
4
6
5
- fs default() {
7
+ group default() {
6
8
crossHLB
7
9
}
8
10
9
- fs crossHLB() {
10
- go.crossBinaries src "github.com/openllb/hlb/cmd/hlb" "github.com/openllb/hlb"
11
- download "./build/dist"
11
+ group crossHLB() {
12
+ go.buildCommonWithOptions src "github.com/openllb/hlb/cmd/hlb" commonBuildArgs option::run{}
13
+ }
14
+
15
+ string version() {
16
+ localRun "git describe --match 'v[0-9]*' --tags --dirty='.dirty' --always | sed 's/^v//'"
17
+ }
18
+
19
+ option::template commonBuildArgs() {
20
+ stringField "goBuildFlags" string {
21
+ template <<~EOM
22
+ -ldflags "-w -s -extldflags -static -X github.com/openllb/hlb.Version={{.version}}"
23
+ EOM with option {
24
+ stringField "version" version
25
+ }
26
+ }
27
+ }
28
+
29
+ fs build() {
30
+ go.buildWithOptions src "github.com/openllb/hlb/cmd/hlb" commonBuildArgs option::run{}
31
+ download "."
12
32
}
13
33
14
34
fs lint() {
15
- go.lint src
35
+ go.lint fs {
36
+ testSrc
37
+ copy fs {
38
+ local ".golangci.yml"
39
+ } "." "."
40
+ }
41
+ }
42
+
43
+ fs test() {
44
+ go.test testSrc
16
45
}
17
46
18
47
fs src() {
19
48
local "." with option {
20
- excludePatterns "build"
49
+ includePatterns "**/*.go" "go.mod" "go.sum"
50
+ excludePatterns "**/*_test.go" "vendor"
21
51
}
22
52
}
23
53
54
+ fs testSrc() {
55
+ # TODO update to use merge-op once available upstream
56
+ src
57
+ copy fs {
58
+ local "." with option {
59
+ includePatterns "**/*_test.go"
60
+ excludePatterns "vendor"
61
+ }
62
+ } "." "."
63
+ }
64
+
24
65
fs gen() {
25
66
mkdocs.generatedBuiltin
26
67
download "./builtin/."
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -46,4 +46,4 @@ replace k8s.io/client-go => k8s.io/client-go v0.0.0-20180806134042-1f13a808da65
46
46
// necessary for langserver with vscode
47
47
replace github.com/sourcegraph/go-lsp => github.com/radeksimko/go-lsp v0.0.0-20200223162147-9f2c54f29c9f
48
48
49
- replace github.com/tonistiigi/fsutil => github.com/coryb/fsutil v0.0.0-20200508061958-7d16a3dcbd1d
49
+ replace github.com/tonistiigi/fsutil => github.com/coryb/fsutil v0.0.0-20200514225115-6114353d9a17
Original file line number Diff line number Diff line change @@ -82,8 +82,8 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz
82
82
github.com/coreos/go-semver v0.2.0 /go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk =
83
83
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e /go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4 =
84
84
github.com/coreos/go-systemd/v22 v22.0.0 /go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk =
85
- github.com/coryb/fsutil v0.0.0-20200508061958-7d16a3dcbd1d h1:A7to1XdmvKRghdKwiC/bc2Y5Uwwu1eg3+eaaAxaNriU =
86
- github.com/coryb/fsutil v0.0.0-20200508061958-7d16a3dcbd1d /go.mod h1:0G1sLZ/0ttFf09xvh7GR4AEECnjifHRNJN/sYbLianU =
85
+ github.com/coryb/fsutil v0.0.0-20200514225115-6114353d9a17 h1:QpblWbcAtXd6PQ/LSVydk7pWzK9gjHcEKoYF3Fd/2xA =
86
+ github.com/coryb/fsutil v0.0.0-20200514225115-6114353d9a17 /go.mod h1:0G1sLZ/0ttFf09xvh7GR4AEECnjifHRNJN/sYbLianU =
87
87
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d /go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU =
88
88
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM =
89
89
github.com/cpuguy83/go-md2man/v2 v2.0.0 /go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU =
You can’t perform that action at this time.
0 commit comments