-
Notifications
You must be signed in to change notification settings - Fork 16
/
.kres.yaml
102 lines (102 loc) · 2.33 KB
/
.kres.yaml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
kind: common.Image
name: image-bldr
spec:
pushLatest: false
extraEnvironment:
PLATFORM: linux/amd64,linux/arm64
entrypointArgs:
- frontend
---
kind: golang.Build
spec:
outputs:
linux-amd64:
GOOS: linux
GOARCH: amd64
linux-arm64:
GOOS: linux
GOARCH: arm64
darwin-amd64:
GOOS: darwin
GOARCH: amd64
darwin-arm64:
GOOS: darwin
GOARCH: arm64
---
kind: service.CodeCov
spec:
targetThreshold: 1
---
kind: golang.Generate
spec:
versionPackagePath: internal/version
---
kind: common.Release
name: release
spec:
artifacts:
- bldr-*
---
kind: auto.CustomSteps
spec:
steps:
- name: integration.test
toplevel: true
- name: integration
toplevel: true
inputs:
- base
---
kind: custom.Step
name: integration.test
spec:
docker:
enabled: true
stages:
- name: integration-build
description: builds the integration test binary
from: base
steps:
- arg: REGISTRY
- arg: USERNAME
- arg: TAG
- arg: VERSION_PKG="github.com/siderolabs/bldr/internal/pkg/constants"
- script:
command: go test -c -tags integration -ldflags "-s -w -X ${VERSION_PKG}.Version=${TAG} -X ${VERSION_PKG}.DefaultOrganization=${USERNAME} -X ${VERSION_PKG}.DefaultRegistry=${REGISTRY}" ./internal/pkg/integration
cache:
- /root/.cache/go-build
- /go/pkg
- name: integration.test
description: copies out the integration test binary
steps:
- copy:
from: integration-build
src: /src/integration.test
dst: /integration.test
makefile:
enabled: true
phony: true
script:
- "@$(MAKE) local-$@ DEST=$(ARTIFACTS)"
---
kind: custom.Step
name: integration
spec:
makefile:
enabled: true
phony: true
depends:
- integration.test
- bldr
variables:
- name: RUN_TESTS
defaultValue: TestIntegration
script:
- "@$(MAKE) image-bldr PUSH=true"
- cp $(ARTIFACTS)/bldr-$(subst /,-,$(PLATFORM)) $(ARTIFACTS)/bldr
- cd internal/pkg/integration && PATH="$$PWD/../../../$(ARTIFACTS):$$PATH" integration.test -test.v -test.run $(RUN_TESTS)
ghaction:
enabled: true
environment:
REGISTRY: registry.dev.siderolabs.io