forked from u-root/u-root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
210 lines (191 loc) · 5.85 KB
/
config.yml
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
version: 2
templates:
golang-template:
&golang-template
docker:
- image: uroottest/test-image-amd64:v5.2.0
working_directory: /home/circleci/go/src/github.com/u-root/u-root
environment:
- UROOT_SOURCE: /home/circleci/go/src/github.com/u-root/u-root
- CGO_ENABLED: 0
# x7 all timeouts for QEMU VM tests since they run without KVM.
- UROOT_QEMU_TIMEOUT_X: 7
integration-template:
&integration-template
working_directory: /home/circleci/go/src/github.com/u-root/u-root
environment:
- UROOT_SOURCE: /home/circleci/go/src/github.com/u-root/u-root
- CGO_ENABLED: 0
# x7 all timeouts for QEMU VM tests since they run without KVM.
- UROOT_QEMU_TIMEOUT_X: 7
steps:
- checkout
- run:
name: Test integration
command: UROOT_QEMU_COVERPROFILE=coverage.txt go test -a -v
-timeout=20m -p=1 -ldflags='-s' -failfast ./integration/...
no_output_timeout: 15m
- run:
name: Upload integration coverage
command: bash <(curl -s https://codecov.io/bash)
beefy-template:
&beefy-template
<<: *golang-template
resource_class: large
workflows:
version: 2
build_and_test:
jobs:
- test-pkgs
- test-cmds
- test-build
- test-tinygo
- test-build-tamago-riscv64
- test-build-tamago-arm
- test-integration-amd64
- test-integration-arm
- test-integration-arm64
- race
- compile_cmds
- check_templates
- check_licenses
jobs:
test-pkgs:
<<: *beefy-template
steps:
- checkout
- run:
name: Test packages
command: UROOT_QEMU_COVERPROFILE=vmcoverage.txt go test -v -a -p=1
-timeout=20m -ldflags='-s' -failfast -coverprofile=coverage_pkg.txt
-covermode=atomic -coverpkg=./pkg/... ./pkg/...
no_output_timeout: 15m
- run:
name: Upload coverage
command: bash <(curl -s https://codecov.io/bash)
test-cmds:
<<: *beefy-template
steps:
- checkout
- run:
name: Test commands
command: UROOT_QEMU_COVERPROFILE=vmcoverage.txt go test -v -p=1
-timeout=20m -failfast -coverprofile=coverage.txt -covermode=atomic
-cover ./cmds/...
- run:
name: Upload coverage
command: bash <(curl -s https://codecov.io/bash)
test-build:
<<: *beefy-template
steps:
- checkout
- run:
name: Test u-root build
command: go test -a -timeout=15m .
no_output_timeout: 15m
test-tinygo:
<<: *beefy-template
steps:
- checkout
- run:
name: tinygo build and test commands
command: echo sooner but not yet docker run --rm -v ~/go:/home/tinygo/go tinygo/tinygo:0.26.0 bash -c 'cd go/src/github.com/u-root/u-root/cmds/core/cmp && tinygo test .'
no_output_timeout: 15m
test-build-tamago-arm:
docker:
- image: uroottest/test-image-tamago:v4.5.0
working_directory: /home/circleci/go/src/github.com/u-root/u-root
environment:
- UROOT_SOURCE: /home/circleci/go/src/github.com/u-root/u-root
- CGO_ENABLED: 0
steps:
- checkout
- run:
name: Test u-root tamago build
command: GOOS=tamago GOARCH=arm GOARM=7 go build ./pkg/dt/...
- run:
name: build armory-boot elf target
command: |
cd /home/circleci
git clone https://github.com/usbarmory/armory-boot.git
cd armory-boot
go version
BOOT=eMMC make elf
test-build-tamago-riscv64:
docker:
- image: uroottest/test-image-tamago:v4.5.0
working_directory: /home/circleci/go/src/github.com/u-root/u-root
environment:
- UROOT_SOURCE: /home/circleci/go/src/github.com/u-root/u-root
- CGO_ENABLED: 0
steps:
- checkout
- run:
name: Test u-root tamago build
command: GOOS=tamago GOARCH=riscv64 go build ./pkg/dt/...
race:
<<: *beefy-template
environment:
- UROOT_SOURCE: /home/circleci/go/src/github.com/u-root/u-root
- CGO_ENABLED: 1
steps:
- checkout
- run:
name: Race detector
command: go test -race -timeout=15m -p=1 -failfast ./cmds/... ./pkg/...
compile_cmds:
<<: *golang-template
steps:
- checkout
- run:
name: build all tools
command: |
cd cmds
go install -a ./...
cd ../tools
go install -a ./...
check_licenses:
<<: *golang-template
steps:
- checkout
- run:
name: Check licenses
command: go run tools/checklicenses/checklicenses.go -c
tools/checklicenses/config.json
check_templates:
<<: *golang-template
steps:
- checkout
- run:
name: Ensure that every template builds for a variety of options.
command: |
go build .
goruncmd="./u-root -stats-output-path=/tmp/stats.json"
$goruncmd minimal
$goruncmd core
$goruncmd coreboot-app
$goruncmd all
$goruncmd world
# Fails because of dups. Is this supposed to work?
#$goruncmd all core
#$goruncmd all core
GOOS=plan9 $goruncmd -defaultsh=/bbin/rush plan9
cat /tmp/stats.json
- store_artifacts:
name: Store build stats
path: /tmp/stats.json
destination: stats.json
test-integration-amd64:
<<: *integration-template
docker:
- image: uroottest/test-image-amd64:v5.2.0
resource_class: large
test-integration-arm:
<<: *integration-template
docker:
- image: uroottest/test-image-arm:v5.1.0
test-integration-arm64:
<<: *integration-template
docker:
- image: uroottest/test-image-arm64:v5.2.0
resource_class: large