-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
67 lines (60 loc) · 1.6 KB
/
.gitlab-ci.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
stages:
- build
- test
# Succeeds if no changes are suggested by gofmt -d .
gofmt:
stage: test
image: golang:1.22
script: if gofmt -d . | grep . ; then false ; else true ; fi
staticcheck v0.5.1:
stage: test
image: golang:1.22
script:
- go install honnef.co/go/tools/cmd/staticcheck@v0.5.1
- staticcheck ./...
compile go 1.22:
stage: build
image: golang:1.22
script:
- go build -v ./...
unittests:
stage: test
image: golang:1.22
script:
- go test -race -v ./...
coverage:
stage: test
image: golang:1.22
script:
- go test ./... -coverprofile=coverage.txt -covermode count
- go install github.com/boumenot/gocover-cobertura@latest
- gocover-cobertura < coverage.txt > coverage.xml
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
integration test:
stage: test
image: golang:1.22
before_script:
- apt-get update
- apt-get install -qqy openssl openssh-client jq unzip file sbsigntool
script:
- make check
stboot integration:
stage: test
image: debian:bookworm-backports
allow_failure: true
before_script:
- apt-get update
- apt-get install -qqy -t bookworm-backports golang-1.22
- apt-get install -qqy qemu-system-x86 wget parted mtools cpio dosfstools git unzip
- export PATH=/usr/lib/go-1.22/bin:$PATH
script:
- git clone https://git.glasklar.is/system-transparency/core/stboot.git
- cd stboot/integration && go work init && go work use . ../.. && ./qemu-boot-from-disk.sh
artifacts:
when: always
paths:
- stboot/integration/out/qemu.log