Skip to content

Commit

Permalink
chore: Update CI to Go 1.18
Browse files Browse the repository at this point in the history
Update Go versions used (current and current-1) in various places
(workflows and Docker images). Update to current Ubuntu runner 20.04.
run go mod tidy to clean up/ correctly order Go deps.

Note: go.mod version not bumped to 1.18 to avoid issues when running
with Go 1.17.

Closes: vmware#2785
Signed-off-by: Michael Gasch <[email protected]>
  • Loading branch information
Michael Gasch committed Mar 25, 2022
1 parent c294107 commit 7d8af1e
Show file tree
Hide file tree
Showing 16 changed files with 605 additions and 232 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
permissions:
actions: read
contents: read
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/govmomi-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
jobs:
artifacts:
name: Build Snapshot Release (no upload)
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
timeout-minutes: 15

steps:
Expand All @@ -40,9 +40,9 @@ jobs:
fetch-depth: 0 # for CHANGELOG

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18

- name: Create CHANGELOG
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/govmomi-check-wip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:

jobs:
wip:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Check WIP in PR Title
uses: embano1/wip@v1
8 changes: 4 additions & 4 deletions .github/workflows/govmomi-go-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:

lint:
name: Lint Files
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
timeout-minutes: 10

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

- name: Check out code
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/govmomi-go-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ jobs:
name: Run Unit Tests
strategy:
matrix:
go-version: ["1.16", "1.17"]
platform: ["ubuntu-latest"]
go-version: ["1.17", "1.18"]
platform: ["ubuntu-20.04"]

runs-on: ${{ matrix.platform }}
timeout-minutes: 10

steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/govmomi-govc-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ jobs:
name: Run govc Tests
strategy:
matrix:
go-version: ["1.16", "1.17"]
platform: ["ubuntu-18.04"]
go-version: ["1.17", "1.18"]
platform: ["ubuntu-20.04"]
cmd: ["govc-test"]
experimental: [false]
timeout: [10]
include:
- go-version: "1.16"
platform: "ubuntu-18.04"
- go-version: "1.18"
platform: "ubuntu-20.04"
cmd: "govc-test-sso"
experimental: true
timeout: 3
- go-version: "1.16"
platform: "ubuntu-18.04"
- go-version: "1.18"
platform: "ubuntu-20.04"
cmd: "govc-test-sso-assert-cert"
experimental: true
timeout: 3
Expand All @@ -49,7 +49,7 @@ jobs:

steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go
Expand All @@ -58,19 +58,22 @@ jobs:
uses: actions/checkout@v2

- name: Run ${{ matrix.cmd }}
run: make ${{ matrix.cmd }}
run: |
# hack: https://github.com/actions/setup-go/issues/107#issuecomment-956161446
cp -f `which go` /usr/bin/go
make ${{ matrix.cmd }}
govc-docs:
name: Verify govc docs are up2date
strategy:
matrix:
go-version: ["1.17"]
platform: ["ubuntu-18.04"]
platform: ["ubuntu-20.04"]
runs-on: ${{ matrix.platform }}
timeout-minutes: 3
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
id: go
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/govmomi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
timeout-minutes: 60

steps:
Expand All @@ -35,9 +35,9 @@ jobs:
fetch-depth: 0 # for CHANGELOG

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18

- name: Create RELEASE CHANGELOG
env:
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
pull-request:
needs: release
name: Create CHANGELOG.md PR
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
continue-on-error: true

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/govmomi-stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:

jobs:
stale:
runs-on: "ubuntu-latest"
runs-on: ubuntu-20.04

steps:
- uses: "actions/stale@v3"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-greeting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
greeting:
name: Send Greeting
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
# only send message to users not (yet) associated with repo
# https://docs.github.com/en/graphql/reference/enums#commentauthorassociation
if: github.event.issue.author_association == 'NONE'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-docker-login.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
jobs:
login:
name: Verify Docker Login
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
timeout-minutes: 3

steps:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.govc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Create a builder container
# golang:1.16.0-buster amd64
FROM golang@sha256:f254180c5defa2653955e963fb0626e3d4fbbb162f7cff6490e94607d1d867ff AS build
# golang:1.18.0-buster amd64
FROM golang@sha256:7d39537344486528f8cdb3bd8adb98ab7f0f4236044b6944fed8631da35a4ce5 AS build
WORKDIR /go/src/app

# Create appuser to isolate potential vulnerabilities
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.vcsim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Create a builder container
# golang:1.16.0-buster amd64
FROM golang@sha256:f254180c5defa2653955e963fb0626e3d4fbbb162f7cff6490e94607d1d867ff AS build
# golang:1.18.0-buster amd64
FROM golang@sha256:7d39537344486528f8cdb3bd8adb98ab7f0f4236044b6944fed8631da35a4ce5 AS build
WORKDIR /go/src/app

# Create appuser to isolate potential vulnerabilities
Expand Down
9 changes: 6 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ go 1.17

require (
github.com/a8m/tree v0.0.0-20210115125333-10a5fd5b637d
github.com/rasky/go-xdr v0.0.0-20170217172119-4930550ba2e2
github.com/google/uuid v1.2.0
github.com/dougm/pretty v0.0.0-20171025230240-2ee9d7453c02
github.com/google/uuid v1.2.0
github.com/rasky/go-xdr v0.0.0-20170217172119-4930550ba2e2
github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728
)

require github.com/kr/text v0.1.0 // indirect
require (
github.com/kr/pretty v0.3.0 // indirect
github.com/kr/text v0.2.0 // indirect
)
11 changes: 10 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
github.com/a8m/tree v0.0.0-20210115125333-10a5fd5b637d h1:4E8RufAN3UQ/weB6AnQ4y5miZCO0Yco8ZdGId41WuQs=
github.com/a8m/tree v0.0.0-20210115125333-10a5fd5b637d/go.mod h1:FSdwKX97koS5efgm8WevNf7XS3PqtyFkKDDXrz778cg=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dougm/pretty v0.0.0-20171025230240-2ee9d7453c02 h1:tR3jsKPiO/mb6ntzk/dJlHZtm37CPfVp1C9KIo534+4=
github.com/dougm/pretty v0.0.0-20171025230240-2ee9d7453c02/go.mod h1:7NQ3kWOx2cZOSjtcveTa5nqupVr2s6/83sG+rTlI7uA=
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/rasky/go-xdr v0.0.0-20170217172119-4930550ba2e2 h1:lbe6PJ3nOQAUvpx9P3GtsQ/jyNBOHLV+cj2++uZrpa4=
github.com/rasky/go-xdr v0.0.0-20170217172119-4930550ba2e2/go.mod h1:Nfe4efndBz4TibWycNE+lqyJZiMX4ycx+QKV8Ta0f/o=
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728 h1:sH9mEk+flyDxiUa5BuPiuhDETMbzrt9A20I2wktMvRQ=
github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728/go.mod h1:x9oS4Wk2s2u4tS29nEaDLdzvuHdB19CvSGJjPgkZJNk=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
4 changes: 2 additions & 2 deletions hack/tools/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/vmware/govmomi-tools

go 1.14
go 1.17

require github.com/golangci/golangci-lint v1.40.1
require github.com/golangci/golangci-lint v1.45.0
Loading

0 comments on commit 7d8af1e

Please sign in to comment.