Skip to content

Commit 88e84ff

Browse files
authored
CI: remove not needed replaces in gomod and add automation (#21212)
* remove un-needed gomod replaces * add a make target gomodtidy * update docs on using gomodtidy * add automation to run go mod tidy on every push * update contributing docs to be more helpful * install gopogh if it is not installed in html_report * addres PR reviews * update docs headings
1 parent c0e46ff commit 88e84ff

File tree

6 files changed

+116
-93
lines changed

6 files changed

+116
-93
lines changed

.github/workflows/go-mod-tidy.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: "go-mod-tidy"
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- master
7+
env:
8+
GOPROXY: https://proxy.golang.org
9+
GO_VERSION: '1.24.0'
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
generate-docs:
15+
if: github.repository == 'kubernetes/minikube'
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
19+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
20+
with:
21+
go-version: ${{env.GO_VERSION}}
22+
- name: Tidy Go Modules
23+
id: gmodtidy
24+
run: |
25+
make gomodtidy
26+
c=$(git status --porcelain)
27+
# The following is to support multiline with GITHUB_OUTPUT, see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
28+
echo "changes<<EOF" >> "$GITHUB_OUTPUT"
29+
echo "$c" >> "$GITHUB_OUTPUT"
30+
echo "EOF" >> "$GITHUB_OUTPUT"
31+
- name: Create PR
32+
if: ${{ steps.gendocs.outputs.changes != '' }}
33+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
34+
with:
35+
token: ${{ secrets.MINIKUBE_BOT_PAT }}
36+
commit-message: Update auto-generated docs and translations
37+
committer: minikube-bot <[email protected]>
38+
author: minikube-bot <[email protected]>
39+
branch: gomodtidy
40+
push-to-fork: minikube-bot/minikube
41+
base: master
42+
delete-branch: true
43+
title: 'go mod tidy'
44+
body: |
45+
Committing changes resulting from `make gomodtidy`.
46+
This PR is auto-generated by the [gendocs](https://github.com/kubernetes/minikube/blob/master/.github/workflows/go-mod-tidy.yml) CI workflow that runs on every push to master.
47+
48+
```
49+
${{ steps.gomodtidy.outputs.changes }}
50+
```

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,11 @@ integration-functional-only: out/minikube$(IS_EXE) ## Trigger only functioanl te
399399
.PHONY: html_report
400400
html_report: ## Generate HTML report out of the last ran integration test logs.
401401
@go tool test2json -t < "./out/testout_$(COMMIT_SHORT).txt" > "./out/testout_$(COMMIT_SHORT).json"
402+
# install gopogh if not already installed
403+
@if ! command -v gopogh >/dev/null 2>&1; then \
404+
echo "gopogh not found, installing..."; \
405+
GOBIN=$(shell go env GOPATH)/bin go install github.com/medyagh/gopogh/cmd/gopogh@latest; \
406+
fi
402407
@gopogh -in "./out/testout_$(COMMIT_SHORT).json" -out ./out/testout_$(COMMIT_SHORT).html -name "$(shell git rev-parse --abbrev-ref HEAD)" -pr "" -repo github.com/kubernetes/minikube/ -details "${COMMIT_SHORT}"
403408
@echo "-------------------------- Open HTML Report in Browser: ---------------------------"
404409
ifeq ($(GOOS),windows)
@@ -1026,6 +1031,12 @@ compare: out/mkcmp out/minikube
10261031
generate-licenses:
10271032
./hack/generate_licenses.sh
10281033

1034+
.PHONY: gomodtidy
1035+
gomodtidy: ## run go mod tidy everywhere needed
1036+
go mod tidy
1037+
cd hack && go mod tidy
1038+
1039+
10291040
.PHONY: help
10301041
help:
10311042
@printf "\033[1mAvailable targets for minikube ${VERSION}\033[21m\n"

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ require (
239239
)
240240

241241
replace (
242-
git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999
243242
github.com/Parallels/docker-machine-parallels/v2 => github.com/minikube-machine/machine-driver-parallels/v2 v2.0.2-0.20240730142131-ada9375ea417
244243
github.com/docker/machine => github.com/minikube-machine/machine v0.0.0-20240815173309-ffb6b643c381
245244
github.com/machine-drivers/docker-machine-driver-vmware => github.com/minikube-machine/machine-driver-vmware v0.1.6-0.20230701123042-a391c48b14d5

hack/go.mod

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@ go 1.24.0
44

55
toolchain go1.24.1
66

7-
replace (
8-
git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999
9-
github.com/Parallels/docker-machine-parallels/v2 => github.com/minikube-machine/machine-driver-parallels/v2 v2.0.2-0.20240730142131-ada9375ea417
10-
github.com/briandowns/spinner => github.com/alonyb/spinner v1.12.7
11-
github.com/docker/machine => github.com/minikube-machine/machine v0.0.0-20240815173309-ffb6b643c381
12-
github.com/machine-drivers/docker-machine-driver-vmware => github.com/minikube-machine/machine-driver-vmware v0.1.6-0.20230701123042-a391c48b14d5
13-
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.22.4
14-
)
7+
replace github.com/docker/machine => github.com/minikube-machine/machine v0.0.0-20240815173309-ffb6b643c381
158

169
require (
1710
cloud.google.com/go/storage v1.55.0

0 commit comments

Comments
 (0)