Skip to content

Commit

Permalink
[ci] upgrade to Go 1.17 everywhere, clean up configs (ko-build#445)
Browse files Browse the repository at this point in the history
* [ci] upgrade to go 1.17 everywhere

* remove unnecessary step names and shell:bash

gofmt with Go v1.17

* add boilerplate to hack/tools.go
  • Loading branch information
imjasonh authored Sep 23, 2021
1 parent 0451db7 commit 5a8663b
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/boilerplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x

- uses: actions/checkout@v2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x

- run: |
go build ./...
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x

- name: Build and run ko container
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kind-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- uses: actions/checkout@v2

- name: Install ko
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/modules-integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,18 @@ on:
branches: ['main']

jobs:

test:
name: Module Tests
strategy:
matrix:
go-version: [1.16.x]
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

go-version: [1.16.x, 1.17.x]
runs-on: 'ubuntu-latest'
steps:

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

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

- name: Test
env:
- env:
GOPATH: does not matter
run: ./integration_test.sh
18 changes: 5 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,12 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v1
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: actions/setup-go@v1
with:
go-version: 1.16.x
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
go-version: 1.17.x
- uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
Expand Down
34 changes: 7 additions & 27 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@ jobs:
importpath: golang.org/x/tools/cmd/goimports

steps:
- name: Set up Go 1.16.x
uses: actions/setup-go@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
id: go

- name: Check out code
uses: actions/checkout@v2
go-version: 1.17.x
- uses: actions/checkout@v2

- name: Install Dependencies
if: ${{ matrix.importpath != '' }}
Expand All @@ -39,7 +35,6 @@ jobs:
GO111MODULE=on go get ${{ matrix.importpath }}
- name: ${{ matrix.tool }} ${{ matrix.options }}
shell: bash
run: >
${{ matrix.tool }} ${{ matrix.options }} -w
$(find .
Expand All @@ -50,7 +45,6 @@ jobs:
-o -type f -name '*.go' -print)
- name: Verify ${{ matrix.tool }}
shell: bash
run: |
# From: https://backreference.org/2009/12/23/how-to-match-newlines-in-sed/
# This is to leverage this workaround:
Expand All @@ -72,14 +66,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.16.x
uses: actions/setup-go@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
id: go

- name: Check out code
uses: actions/checkout@v2
go-version: 1.17.x
- uses: actions/checkout@v2

- name: Install Tools
env:
Expand All @@ -102,18 +92,11 @@ jobs:
echo "${TEMP_PATH}" >> $GITHUB_PATH
- id: golangci_configuration
uses: andstor/file-existence-action@v1
with:
files: .golangci.yaml
- name: Go Lint
if: steps.golangci_configuration.outputs.files_exists == 'true'
uses: golangci/golangci-lint-action@v2
- uses: golangci/golangci-lint-action@v2
with:
version: v1.38

- name: misspell
shell: bash
if: ${{ always() }}
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -141,7 +124,6 @@ jobs:
echo '::endgroup::'
- name: trailing whitespace
shell: bash
if: ${{ always() }}
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -170,7 +152,6 @@ jobs:
echo '::endgroup::'
- name: EOF newline
shell: bash
if: ${{ always() }}
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -213,7 +194,6 @@ jobs:
# since their action is not yet released under a stable version.
- name: Language
if: ${{ always() && github.event_name == 'pull_request' }}
shell: bash
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x

- run: go test -coverprofile=coverage.txt -covermode=atomic -race ./...

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- uses: actions/checkout@v2
- name: Verify
run: ./hack/presubmit.sh
15 changes: 15 additions & 0 deletions hack/tools.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
// Copyright 2021 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build tools
// +build tools

package hack
Expand Down

0 comments on commit 5a8663b

Please sign in to comment.