-
Notifications
You must be signed in to change notification settings - Fork 8
/
Earthfile
41 lines (34 loc) · 1.06 KB
/
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
VERSION 0.7
# renovate: datasource=docker depName=golang
ARG --global GO_VERSION=1.23
# renovate: datasource=docker depName=golangci-lint
ARG --global GOLINT_VERSION=1.61.0
# renovate: datasource=docker depName=quay.io/luet/base
ARG --global LUET_VERSION=0.34.0
luet:
FROM quay.io/luet/base:$LUET_VERSION
SAVE ARTIFACT /usr/bin/luet /luet
go-deps:
ARG GO_VERSION
FROM golang:$GO_VERSION-alpine
WORKDIR /build
COPY . .
RUN go mod tidy
RUN go mod download
RUN go mod verify
test:
FROM +go-deps
ENV CGO_ENABLED=0
WORKDIR /build
COPY +luet/luet /usr/bin/luet
# Some tests need the docker client available
WITH DOCKER
RUN go run github.com/onsi/ginkgo/v2/ginkgo run --fail-fast --covermode=atomic --coverprofile=coverage.out -p -r ./...
END
SAVE ARTIFACT coverage.out AS LOCAL coverage.out
lint:
FROM +go-deps
ARG GOLINT_VERSION
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v$GOLINT_VERSION
WORKDIR /build
RUN bin/golangci-lint run -v