-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEarthfile
32 lines (28 loc) · 861 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
VERSION 0.6
ARG GO_VERSION=1.18
ARG GOLINT_VERSION=1.47.3
go-deps:
ARG GO_VERSION
FROM golang:$GO_VERSION
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
RUN apt-get update
SAVE ARTIFACT go.mod AS LOCAL go.mod
SAVE ARTIFACT go.sum AS LOCAL go.sum
test:
FROM +go-deps
ARG OPENAI_API_TOKEN
WORKDIR /build
RUN go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
COPY . .
RUN ginkgo run --race --fail-fast --slow-spec-threshold 30s --covermode=atomic --coverprofile=coverage.out -p -r ./
SAVE ARTIFACT coverage.out AS LOCAL coverage.out
lint:
ARG GO_VERSION
FROM golang:$GO_VERSION
ARG GOLINT_VERSION
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v$GOLINT_VERSION
WORKDIR /build
COPY . .
RUN golangci-lint run