From 61e601c9bd4d24175a765da023eaecf4b410254b Mon Sep 17 00:00:00 2001 From: Moulick Aggarwal Date: Tue, 30 Jul 2024 21:07:04 +0200 Subject: [PATCH] Check for go mod tidy Add a step to check for go mod tidy in the CI workflow. Also configure renovate to run go mod tidy when bumping dependencies. Signed-off-by: Moulick Aggarwal --- .github/workflows/ci.yml | 9 ++++++--- renovate.json | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0cc464a..8597b0b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,9 @@ jobs: go-version: ${{ env.GO_VERSION }} cache: false # The golangci-lint action does its own caching. + - name: Check go mod tidy + run: go mod tidy && git diff --exit-code go.mod go.sum + - name: Lint uses: golangci/golangci-lint-action@v6 with: @@ -70,7 +73,7 @@ jobs: # We want to build most packages for the amd64 and arm64 architectures. To # speed this up we build single-platform packages in parallel. We then upload # those packages to GitHub as a build artifact. The push job downloads those - # artifacts and pushes them as a single multi-platform package. + # artifacts and pushes them as a single multi-platform package. build: runs-on: ubuntu-24.04 strategy: @@ -108,13 +111,13 @@ jobs: build-args: GO_VERSION=${{ env.GO_VERSION }} outputs: type=docker,dest=runtime-${{ matrix.arch }}.tar - + - name: Setup the Crossplane CLI run: "curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh" - name: Build Package run: ./crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar - + - name: Upload Single-Platform Package uses: actions/upload-artifact@v4 with: diff --git a/renovate.json b/renovate.json index 82b19d03..21e99bbd 100644 --- a/renovate.json +++ b/renovate.json @@ -12,5 +12,9 @@ "matchFileNames": ["example/**"], "groupName": "examples" } + ], + "postUpdateOptions": [ + "gomodTidy", + "gomodUpdateImportPaths" ] }