-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
45 lines (38 loc) · 879 Bytes
/
Earthfile
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
VERSION 0.8
deps:
FROM golang:1.23.1-alpine
ENV CGO_ENABLED 0
WORKDIR /src
COPY . .
RUN go work init
RUN go work use .
RUN go work use ./internal/tools
RUN go work use ./peers
RUN go work use ./spop
RUN go mod download
tools:
FROM +deps
RUN go install honnef.co/go/tools/cmd/staticcheck
RUN go install golang.org/x/tools/cmd/stringer
RUN go install ./internal/tools/vet
validate:
FROM +tools
RUN $GOPATH/bin/staticcheck ./...
RUN $GOPATH/bin/vet ./...
go-test:
FROM +deps
RUN mkdir e2e
FOR target IN './spop' './peers' './...'
RUN go test $target
RUN go test -tags e2e -o e2e -c $target
END
SAVE ARTIFACT e2e
e2e:
FROM haproxy:2.9-alpine
COPY +go-test/e2e e2e
FOR test IN $(ls ./e2e)
RUN ./e2e/$test
END
test:
BUILD +validate
BUILD +e2e