mirror of
https://github.com/crazy-max/diun.git
synced 2025-01-12 19:48:12 +00:00
3bbe883358
* Upload artifacts * Add image-local target * Single job for artifacts and image * Add armv5 artifact Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
20 lines
575 B
Docker
20 lines
575 B
Docker
# syntax=docker/dockerfile:1.2
|
|
ARG GO_VERSION=1.15
|
|
|
|
FROM golang:${GO_VERSION}-alpine AS base
|
|
RUN apk add --no-cache gcc musl-dev
|
|
WORKDIR /src
|
|
|
|
FROM base AS gomod
|
|
RUN --mount=type=bind,target=.,rw \
|
|
--mount=type=cache,target=/go/pkg/mod \
|
|
go mod tidy && go mod download
|
|
|
|
FROM gomod AS test
|
|
RUN --mount=type=bind,target=. \
|
|
--mount=type=cache,target=/go/pkg/mod \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
go test -v -coverprofile=/tmp/coverage.txt -covermode=atomic -race ./...
|
|
|
|
FROM scratch AS test-coverage
|
|
COPY --from=test /tmp/coverage.txt /coverage.txt
|