-
Notifications
You must be signed in to change notification settings - Fork 22
/
.kres.yaml
176 lines (176 loc) · 4.92 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
kind: golang.Generate
spec:
versionPackagePath: internal/version
---
kind: golang.Build
spec:
outputs:
linux-amd64:
GOOS: linux
GOARCH: amd64
linux-arm64:
GOOS: linux
GOARCH: arm64
---
kind: common.Image
name: image-image-factory
spec:
baseImage: alpine:3.20.3
extraEnvironment:
PLATFORM: linux/amd64,linux/arm64
additionalImages: []
allowedLocalPaths:
- tailwind.config.js
- package.json
- package-lock.json
dependsOn:
- tailwind
customCommands:
- apk add --no-cache --update
bash
binutils-aarch64
binutils-x86_64
cpio
dosfstools
e2fsprogs
efibootmgr
kmod
mtools
pigz
qemu-img
squashfs-tools
tar
util-linux
xfsprogs
xorriso
xz
zstd
copyFrom:
- stage: ghcr.io/siderolabs/grub:v1.9.0
source: /
destination: /
- stage: ghcr.io/siderolabs/grub@sha256:4aea36c88627add06512a14c7e571b43405b6eeeca0a8ad295b8c4e31bf57721 # amd64
source: /usr/lib/grub
destination: /usr/lib/grub
- stage: ghcr.io/siderolabs/grub@sha256:d82f11c8a7dc61fcdcc1d93d9550a1624eb291829a90700983e1c5b1a3b6cc26 # arm64
source: /usr/lib/grub
destination: /usr/lib/grub
- stage: ghcr.io/siderolabs/installer:v1.9.0-alpha.2
source: /usr/share/grub/unicode.pf2
destination: /usr/share/grub/unicode.pf2
---
kind: auto.CustomSteps
spec:
steps:
- name: integration.test
toplevel: true
- name: integration
toplevel: true
- name: tailwind
toplevel: true
---
kind: custom.Step
name: integration.test
spec:
docker:
enabled: true
stages:
- name: integration-build
description: builds the integration test binary
from: base
steps:
- script:
command: go test -c -covermode=atomic -coverpkg=./... -tags integration ./internal/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
variables:
- name: RUN_TESTS
defaultValue: TestIntegration
- name: TEST_FLAGS
defaultValue: ""
script:
- "@$(MAKE) image-image-factory PUSH=true"
- docker pull $(REGISTRY)/$(USERNAME)/image-factory:$(TAG)
- docker run --rm --net=host --privileged -v /dev:/dev -v $(PWD)/$(ARTIFACTS)/integration.test:/bin/integration.test:ro --entrypoint /bin/integration.test $(REGISTRY)/$(USERNAME)/image-factory:$(TAG) -test.v $(TEST_FLAGS) -test.run $(RUN_TESTS)
ghaction:
enabled: true
environment:
REGISTRY: registry.dev.siderolabs.io
TEST_FLAGS: "-test.schematic-service-repository=registry.dev.siderolabs.io/image-factory/schematic -test.installer-external-repository=registry.dev.siderolabs.io/siderolabs -test.installer-internal-repository=registry.dev.siderolabs.io/siderolabs -test.cache-repository=registry.dev.siderolabs.io/image-factory/cache"
---
kind: common.Build
spec:
ignoredPaths:
- node_modules/
---
kind: service.CodeCov
spec:
targetThreshold: 9 # the actual coverage is much higher and reported from the integration test
---
kind: custom.Step
name: tailwind
spec:
makefile:
enabled: true
phony: true
script:
- "@$(MAKE) local-tailwind-copy PUSH=false DEST=. PLATFORM=linux/amd64 BUILDKIT_MULTI_PLATFORM=0"
docker:
description: "Runs tailwind update"
enabled: true
stages:
- name: tailwind-base
description: "Installs tailwindcss"
from: docker.io/node:21.7.3-alpine3.19
workdir: /src
steps:
- copy:
src: package.json package-lock.json
dst: .
- script:
cache:
- /src/node_modules
command: npm ci
- name: tailwind-update
description: "tailwind update"
from: tailwind-base
steps:
- copy:
src: tailwind.config.js
dst: .
- copy:
src: internal/frontend/http
dst: internal/frontend/http
- script:
cache:
- /src/node_modules
command: node_modules/.bin/tailwindcss -i internal/frontend/http/css/input.css -o internal/frontend/http/css/output.css --minify
- name: tailwind-copy
description: "Copies assets"
steps:
- copy:
from: tailwind-update
src: /src/internal/frontend/http/css/output.css
dst: internal/frontend/http/css/output.css