Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 8839c52

Browse files
authored
Merge pull request #2174 from crazy-max/go-1.18
Go 1.18
2 parents 0978185 + 5780bc5 commit 8839c52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+274
-145
lines changed

Diff for: .github/workflows/aci-tests.yml

+10-14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
env:
10+
GO_VERSION: 1.18
11+
912
jobs:
1013
check-optional-tests:
1114
name: Check if needs to run ACI tests
@@ -23,30 +26,23 @@ jobs:
2326
aci-tests:
2427
name: ACI e2e tests
2528
runs-on: ubuntu-latest
26-
env:
27-
GO111MODULE: "on"
2829
needs: check-optional-tests
2930
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-aci == 'true'
3031
steps:
31-
- name: Set up Go 1.16
32-
uses: actions/setup-go@v2
32+
- name: Checkout code into the Go module directory
33+
uses: actions/checkout@v3
34+
35+
- name: Set up Go
36+
uses: actions/setup-go@v3
3337
with:
34-
go-version: 1.16
35-
id: go
38+
go-version: ${{ env.GO_VERSION }}
39+
cache: true
3640

3741
- name: Setup docker CLI
3842
run: |
3943
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
4044
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
4145
42-
- name: Checkout code into the Go module directory
43-
uses: actions/checkout@v2
44-
45-
- uses: actions/cache@v2
46-
with:
47-
path: ~/go/pkg/mod
48-
key: go-${{ hashFiles('**/go.sum') }}
49-
5046
- name: Build for ACI e2e tests
5147
run: make -f builder.Makefile cli
5248

Diff for: .github/workflows/ci.yml

+24-37
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@ on:
66
- main
77
pull_request:
88

9+
env:
10+
GO_VERSION: 1.18
11+
912
jobs:
1013
lint:
1114
name: Lint
1215
runs-on: ubuntu-latest
13-
env:
14-
GO111MODULE: "on"
1516
steps:
16-
- name: Set up Go 1.16
17-
uses: actions/setup-go@v2
18-
with:
19-
go-version: 1.16
20-
id: go
21-
2217
- name: Checkout code into the Go module directory
23-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v3
22+
with:
23+
go-version: ${{ env.GO_VERSION }}
24+
cache: true
2425

2526
- name: Validate go-mod is up-to-date and license headers
2627
run: make validate
@@ -29,30 +30,23 @@ jobs:
2930
env:
3031
BUILD_TAGS: kube,e2e
3132
run: |
32-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.39.0
33+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.45.2
3334
make -f builder.Makefile lint
3435
3536
# only on main branch, costs too much for the gain on every PR
3637
validate-cross-build:
3738
name: Validate cross build
3839
runs-on: ubuntu-latest
3940
if: github.ref == 'refs/heads/main'
40-
env:
41-
GO111MODULE: "on"
4241
steps:
43-
- name: Set up Go 1.16
44-
uses: actions/setup-go@v2
45-
with:
46-
go-version: 1.16
47-
id: go
48-
4942
- name: Checkout code into the Go module directory
50-
uses: actions/checkout@v2
43+
uses: actions/checkout@v3
5144

52-
- uses: actions/cache@v2
45+
- name: Set up Go
46+
uses: actions/setup-go@v3
5347
with:
54-
path: ~/go/pkg/mod
55-
key: go-${{ hashFiles('**/go.sum') }}
48+
go-version: ${{ env.GO_VERSION }}
49+
cache: true
5650

5751
# Ensure we don't discover cross platform build issues at release time.
5852
# Time used to build linux here is gained back in the build for local E2E step
@@ -62,32 +56,25 @@ jobs:
6256
build:
6357
name: Build
6458
runs-on: ubuntu-latest
65-
env:
66-
GO111MODULE: "on"
6759
steps:
68-
- name: Set up Go 1.16
69-
uses: actions/setup-go@v2
60+
- name: Checkout code into the Go module directory
61+
uses: actions/checkout@v3
62+
63+
- name: Set up Go
64+
uses: actions/setup-go@v3
7065
with:
71-
go-version: 1.16
72-
id: go
66+
go-version: ${{ env.GO_VERSION }}
67+
cache: true
7368

7469
- name: Set up gosum
7570
run: |
76-
go get -u gotest.tools/gotestsum
71+
go install gotest.tools/gotestsum@latest
7772
7873
- name: Setup docker CLI
7974
run: |
8075
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
8176
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
8277
83-
- name: Checkout code into the Go module directory
84-
uses: actions/checkout@v2
85-
86-
- uses: actions/cache@v2
87-
with:
88-
path: ~/go/pkg/mod
89-
key: go-${{ hashFiles('**/go.sum') }}
90-
9178
- name: Test
9279
env:
9380
BUILD_TAGS: kube

Diff for: .github/workflows/cli-release.yaml

+11-14
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,28 @@ on:
1010
description: 'Dry run'
1111
required: false
1212
default: 'true'
13+
14+
env:
15+
GO_VERSION: 1.18
16+
1317
jobs:
1418
release:
1519
runs-on: ubuntu-latest
1620
steps:
17-
- name: Set up Go 1.16
18-
uses: actions/setup-go@v2
21+
- name: Checkout code into the Go module directory
22+
uses: actions/checkout@v3
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v3
1926
with:
20-
go-version: 1.16
21-
id: go
27+
go-version: ${{ env.GO_VERSION }}
28+
cache: true
2229

2330
- name: Setup docker CLI
2431
run: |
2532
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
2633
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
2734
28-
- name: Checkout code into the Go module directory
29-
uses: actions/checkout@v2
30-
31-
- uses: actions/cache@v2
32-
with:
33-
path: ~/go/pkg/mod
34-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
35-
restore-keys: |
36-
${{ runner.os }}-go-
37-
3835
- name: Build
3936
run: make GIT_TAG=${{ github.event.inputs.tag }} -f builder.Makefile cross
4037

Diff for: .github/workflows/ecs-tests.yml

+10-15
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
env:
10+
GO_VERSION: 1.18
11+
912
jobs:
1013
check-optional-tests:
1114
name: Check if needs to run ECS tests
@@ -20,34 +23,26 @@ jobs:
2023
with:
2124
trigger: '/test-ecs'
2225

23-
2426
ecs-tests:
2527
name: ECS e2e tests
2628
runs-on: ubuntu-latest
27-
env:
28-
GO111MODULE: "on"
2929
needs: check-optional-tests
3030
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-ecs == 'true'
3131
steps:
32-
- name: Set up Go 1.16
33-
uses: actions/setup-go@v2
32+
- name: Checkout code into the Go module directory
33+
uses: actions/checkout@v3
34+
35+
- name: Set up Go
36+
uses: actions/setup-go@v3
3437
with:
35-
go-version: 1.16
36-
id: go
38+
go-version: ${{ env.GO_VERSION }}
39+
cache: true
3740

3841
- name: Setup docker CLI
3942
run: |
4043
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
4144
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
4245
43-
- name: Checkout code into the Go module directory
44-
uses: actions/checkout@v2
45-
46-
- uses: actions/cache@v2
47-
with:
48-
path: ~/go/pkg/mod
49-
key: go-${{ hashFiles('**/go.sum') }}
50-
5146
- name: Build for ECS e2e tests
5247
run: make -f builder.Makefile cli
5348

Diff for: .github/workflows/kube-tests.yml

+10-15
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
env:
10+
GO_VERSION: 1.18
11+
912
jobs:
1013
check-optional-tests:
1114
name: Check if needs to run Kube tests
@@ -20,20 +23,20 @@ jobs:
2023
with:
2124
trigger: '/test-kube'
2225

23-
2426
kube-tests:
2527
name: Kube e2e tests
2628
runs-on: ubuntu-latest
27-
env:
28-
GO111MODULE: "on"
2929
needs: check-optional-tests
3030
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-kube == 'true'
3131
steps:
32-
- name: Set up Go 1.16
33-
uses: actions/setup-go@v2
32+
- name: Checkout code into the Go module directory
33+
uses: actions/checkout@v3
34+
35+
- name: Set up Go
36+
uses: actions/setup-go@v3
3437
with:
35-
go-version: 1.16
36-
id: go
38+
go-version: ${{ env.GO_VERSION }}
39+
cache: true
3740

3841
- name: Setup docker CLI
3942
run: |
@@ -46,14 +49,6 @@ jobs:
4649
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.10.0/kind-linux-amd64 && chmod +x ./kind && sudo mv ./kind /usr/bin/ && kind version
4750
curl -LO "https://dl.k8s.io/release/v1.20.2/bin/linux/amd64/kubectl" && sudo mv kubectl /usr/bin/ && kubectl version --client
4851
49-
- name: Checkout code into the Go module directory
50-
uses: actions/checkout@v2
51-
52-
- uses: actions/cache@v2
53-
with:
54-
path: ~/go/pkg/mod
55-
key: go-${{ hashFiles('**/go.sum') }}
56-
5752
- name: Build for Kube e2e tests
5853
env:
5954
BUILD_TAGS: kube

Diff for: .github/workflows/rebase.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout the latest code
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313
with:
1414
token: ${{ secrets.GITHUB_TOKEN }}
1515
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo

Diff for: .github/workflows/windows-ci.yml

+10-13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
env:
10+
GO_VERSION: 1.18
11+
912
jobs:
1013
check-optional-tests:
1114
name: Check if needs to run Windows build and tests
@@ -20,7 +23,6 @@ jobs:
2023
with:
2124
trigger: '/test-windows'
2225

23-
2426
windows-build:
2527
name: Windows Build
2628
runs-on: windows-latest
@@ -29,11 +31,14 @@ jobs:
2931
needs: check-optional-tests
3032
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-windows == 'true'
3133
steps:
32-
- name: Set up Go 1.16
33-
uses: actions/setup-go@v2
34+
- name: Checkout code into the Go module directory
35+
uses: actions/checkout@v3
36+
37+
- name: Set up Go
38+
uses: actions/setup-go@v3
3439
with:
35-
go-version: 1.16
36-
id: go
40+
go-version: ${{ env.GO_VERSION }}
41+
cache: true
3742

3843
- name: Setup docker CLI
3944
run: |
@@ -42,14 +47,6 @@ jobs:
4247
mv -Force ./docker.exe "C:\Program Files\Docker\"
4348
docker version
4449
45-
- name: Checkout code into the Go module directory
46-
uses: actions/checkout@v2
47-
48-
- uses: actions/cache@v2
49-
with:
50-
path: ~/go/pkg/mod
51-
key: go-${{ hashFiles('**/go.sum') }}
52-
5350
- name: Test
5451
run: make -f builder.Makefile test
5552

0 commit comments

Comments
 (0)