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

Commit

Permalink
Merge pull request #2174 from crazy-max/go-1.18
Browse files Browse the repository at this point in the history
Go 1.18
  • Loading branch information
glours authored Jul 25, 2022
2 parents 0978185 + 5780bc5 commit 8839c52
Show file tree
Hide file tree
Showing 42 changed files with 274 additions and 145 deletions.
24 changes: 10 additions & 14 deletions .github/workflows/aci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- main
pull_request:

env:
GO_VERSION: 1.18

jobs:
check-optional-tests:
name: Check if needs to run ACI tests
Expand All @@ -23,30 +26,23 @@ jobs:
aci-tests:
name: ACI e2e tests
runs-on: ubuntu-latest
env:
GO111MODULE: "on"
needs: check-optional-tests
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-aci == 'true'
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v2
- name: Checkout code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
id: go
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Setup docker CLI
run: |
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
- name: Checkout code into the Go module directory
uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: go-${{ hashFiles('**/go.sum') }}

- name: Build for ACI e2e tests
run: make -f builder.Makefile cli

Expand Down
61 changes: 24 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@ on:
- main
pull_request:

env:
GO_VERSION: 1.18

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
GO111MODULE: "on"
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.16
id: go

- name: Checkout code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Validate go-mod is up-to-date and license headers
run: make validate
Expand All @@ -29,30 +30,23 @@ jobs:
env:
BUILD_TAGS: kube,e2e
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.39.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.45.2
make -f builder.Makefile lint
# only on main branch, costs too much for the gain on every PR
validate-cross-build:
name: Validate cross build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
env:
GO111MODULE: "on"
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.16
id: go

- name: Checkout code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- uses: actions/cache@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
path: ~/go/pkg/mod
key: go-${{ hashFiles('**/go.sum') }}
go-version: ${{ env.GO_VERSION }}
cache: true

# Ensure we don't discover cross platform build issues at release time.
# Time used to build linux here is gained back in the build for local E2E step
Expand All @@ -62,32 +56,25 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
GO111MODULE: "on"
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v2
- name: Checkout code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
id: go
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Set up gosum
run: |
go get -u gotest.tools/gotestsum
go install gotest.tools/gotestsum@latest
- name: Setup docker CLI
run: |
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
- name: Checkout code into the Go module directory
uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: go-${{ hashFiles('**/go.sum') }}

- name: Test
env:
BUILD_TAGS: kube
Expand Down
25 changes: 11 additions & 14 deletions .github/workflows/cli-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,28 @@ on:
description: 'Dry run'
required: false
default: 'true'

env:
GO_VERSION: 1.18

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v2
- name: Checkout code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
id: go
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Setup docker CLI
run: |
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
- name: Checkout code into the Go module directory
uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
run: make GIT_TAG=${{ github.event.inputs.tag }} -f builder.Makefile cross

Expand Down
25 changes: 10 additions & 15 deletions .github/workflows/ecs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- main
pull_request:

env:
GO_VERSION: 1.18

jobs:
check-optional-tests:
name: Check if needs to run ECS tests
Expand All @@ -20,34 +23,26 @@ jobs:
with:
trigger: '/test-ecs'


ecs-tests:
name: ECS e2e tests
runs-on: ubuntu-latest
env:
GO111MODULE: "on"
needs: check-optional-tests
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-ecs == 'true'
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v2
- name: Checkout code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
id: go
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Setup docker CLI
run: |
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
- name: Checkout code into the Go module directory
uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: go-${{ hashFiles('**/go.sum') }}

- name: Build for ECS e2e tests
run: make -f builder.Makefile cli

Expand Down
25 changes: 10 additions & 15 deletions .github/workflows/kube-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- main
pull_request:

env:
GO_VERSION: 1.18

jobs:
check-optional-tests:
name: Check if needs to run Kube tests
Expand All @@ -20,20 +23,20 @@ jobs:
with:
trigger: '/test-kube'


kube-tests:
name: Kube e2e tests
runs-on: ubuntu-latest
env:
GO111MODULE: "on"
needs: check-optional-tests
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-kube == 'true'
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v2
- name: Checkout code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
id: go
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Setup docker CLI
run: |
Expand All @@ -46,14 +49,6 @@ jobs:
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
curl -LO "https://dl.k8s.io/release/v1.20.2/bin/linux/amd64/kubectl" && sudo mv kubectl /usr/bin/ && kubectl version --client
- name: Checkout code into the Go module directory
uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: go-${{ hashFiles('**/go.sum') }}

- name: Build for Kube e2e tests
env:
BUILD_TAGS: kube
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
Expand Down
23 changes: 10 additions & 13 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- main
pull_request:

env:
GO_VERSION: 1.18

jobs:
check-optional-tests:
name: Check if needs to run Windows build and tests
Expand All @@ -20,7 +23,6 @@ jobs:
with:
trigger: '/test-windows'


windows-build:
name: Windows Build
runs-on: windows-latest
Expand All @@ -29,11 +31,14 @@ jobs:
needs: check-optional-tests
if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-windows == 'true'
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v2
- name: Checkout code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
id: go
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Setup docker CLI
run: |
Expand All @@ -42,14 +47,6 @@ jobs:
mv -Force ./docker.exe "C:\Program Files\Docker\"
docker version
- name: Checkout code into the Go module directory
uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: go-${{ hashFiles('**/go.sum') }}

- name: Test
run: make -f builder.Makefile test

Expand Down
Loading

0 comments on commit 8839c52

Please sign in to comment.