From 2f24a79d4dac724e444f0f909441891f24887423 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Fri, 22 Jan 2021 13:20:54 +0000 Subject: [PATCH] CI: Go mod tidy check --- .github/workflows/build.yml | 3 +++ Dockerfile | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf2ff728..69bc44b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,9 @@ jobs: - name: Linting run: docker build --target lint . + - name: Go mod tidy check + run: docker build --target tidy . + - name: Build test image run: docker build --target test -t test-container . diff --git a/Dockerfile b/Dockerfile index 2d7bec22..ee1e5b5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,15 @@ RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master COPY .golangci.yml ./ RUN golangci-lint run --timeout=10m +FROM --platform=$BUILDPLATFORM base AS tidy +RUN git init && \ + git config user.email ci@localhost && \ + git config user.name ci && \ + git add -A && git commit -m ci && \ + sed -i '/\/\/ indirect/d' go.mod && \ + go mod tidy && \ + git diff --exit-code -- go.mod + FROM --platform=$BUILDPLATFORM base AS build COPY --from=qmcgaw/xcputranslate:v0.4.0 /xcputranslate /usr/local/bin/xcputranslate ARG TARGETPLATFORM