Skip to content

Commit 828b67b

Browse files
committed
Run "go mod tidy" only if Go is >= 1.16
Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent 7f43605 commit 828b67b

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

.buildkite/pipeline.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,6 @@ steps:
6565
- test -z "$(git status --porcelain)" && exit 0 || git status && echo -e '\nGenerated protobuf code differs from committed, please run "make proto" and commit the updated files.\n' && exit 1
6666
timeout_in_minutes: 1
6767

68-
- label: ":golang: go mod tidy"
69-
agents:
70-
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
71-
distro: "${BUILDKITE_AGENT_META_DATA_DISTRO}"
72-
hostname: "${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
73-
env:
74-
DOCKER_IMAGE_TAG: "$BUILDKITE_BUILD_NUMBER"
75-
command:
76-
- make tidy-in-docker
77-
- test -z "$(git status --porcelain)" && exit 0 || git status && echo -e '\ngo.mod and/or go.sum differ from committed, please run "go mod tidy" and commit the updated files.\n' && exit 1
78-
timeout_in_minutes: 1
79-
8068
- label: ":gear: unit tests"
8169
agents:
8270
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"

.github/workflows/build.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ jobs:
4747
- run: |
4848
make tidy
4949
git diff --exit-code
50-
# The result of "go mod tidy" is different since Go 1.16.
51-
# We will use the old result until we update BuildKite and other environments.
52-
if: matrix.go < '1.16'
50+
# opencontainers/selinux uses Go 1.16's io/fs package with "go1.16"
51+
# build tag. However, since go mod tidy acts as like all build tags
52+
# are enabled, the file below included in go mod tidy, even
53+
# Go is < 1.16.
54+
# https://github.com/opencontainers/selinux/blob/v1.9.1/go-selinux/rchcon.go
55+
# https://golang.org/ref/mod
56+
if: matrix.go >= '1.16'
5357
- run: |
5458
make proto
5559
git diff --exit-code

0 commit comments

Comments
 (0)