Skip to content

Commit

Permalink
Fix presubmit (#1161)
Browse files Browse the repository at this point in the history
- gofmt things using Go 1.17+
- go install @Version instead of go get
- go get some k8schain deps
  • Loading branch information
imjasonh committed Nov 1, 2021
1 parent dd86162 commit 0dfbb56
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 27 deletions.
31 changes: 8 additions & 23 deletions .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,19 @@
name: Presubmit

on:

push:
branches: [ 'main', 'master' ]

branches: ['main']
pull_request:
branches: [ 'main', 'master', 'release-*' ]
branches: ['main']

jobs:

test:
presubmit:
name: Presubmit
strategy:
matrix:
go-version: [1.15.x]
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}
runs-on: 'ubuntu-latest'

steps:

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code
uses: actions/checkout@v2

- name: Run presubmit
run: ./hack/presubmit.sh
go-version: 1.16.x
- run: ./hack/presubmit.sh
4 changes: 2 additions & 2 deletions hack/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ TMP_DIR="$(mktemp -d)"
export PATH="${PATH}:${TMP_DIR}/bin"
pushd ${TMP_DIR}
trap popd EXIT
go get -v -u golang.org/x/lint/golint
go get honnef.co/go/tools/cmd/staticcheck
go install golang.org/x/lint/golint@v0.0.0-20210508222113-6edffad5e616
go install honnef.co/go/tools/cmd/staticcheck@v0.2.1
popd

pushd ${PROJECT_ROOT}
Expand Down
1 change: 1 addition & 0 deletions internal/signal/go116.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.16
// +build go1.16

package signal
Expand Down
1 change: 1 addition & 0 deletions internal/signal/signal.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !go1.16
// +build !go1.16

package signal
Expand Down
84 changes: 84 additions & 0 deletions pkg/authn/k8schain/go.sum

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pkg/authn/k8schain/k8schain_aws.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//go:build !disable_aws
// +build !disable_aws

// Copyright 2019 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 2 additions & 0 deletions pkg/authn/k8schain/k8schain_azure.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//go:build !disable_azure
// +build !disable_azure

// Copyright 2019 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 2 additions & 0 deletions pkg/authn/k8schain/k8schain_gcp.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//go:build !disable_gcp
// +build !disable_gcp

// Copyright 2019 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions pkg/name/internal/must_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build compile
// +build compile

// Copyright 2021 Google LLC All Rights Reserved.
Expand Down
5 changes: 3 additions & 2 deletions pkg/v1/google/auth_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// +build !arm64
// +build !darwin
//go:build !arm64 && !darwin
// +build !arm64,!darwin

// Copyright 2018 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions pkg/v1/remote/check_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration
// +build integration

package remote
Expand Down
1 change: 1 addition & 0 deletions pkg/v1/zz_deepcopy_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0dfbb56

Please sign in to comment.