github.com/noisysockets/noisysockets@v0.21.2-0.20240515114641-7f467e651c90/Earthfile (about) 1 VERSION 0.7 2 FROM golang:1.22-bookworm 3 WORKDIR /workspace 4 5 tidy: 6 LOCALLY 7 RUN go mod tidy 8 RUN go fmt ./... 9 10 lint: 11 FROM golangci/golangci-lint:v1.57.2 12 WORKDIR /workspace 13 COPY . . 14 RUN golangci-lint run --timeout 5m ./... 15 16 test: 17 FROM +tools 18 COPY go.mod go.sum . 19 RUN go mod download 20 COPY . . 21 RUN go test -coverprofile=coverage.out -v ./... 22 SAVE ARTIFACT coverage.out AS LOCAL coverage.out 23 WORKDIR /workspace/tests 24 WITH DOCKER 25 RUN go test -timeout=300s -v ./... 26 END 27 WORKDIR /workspace/examples 28 WITH DOCKER 29 RUN for example in $(find . -name 'main.go'); do \ 30 go run "$example" || exit 1; \ 31 done 32 END 33 34 tools: 35 RUN apt update && apt install -y ca-certificates curl jq 36 RUN curl -fsSL https://get.docker.com | bash