Skip to content

Commit

Permalink
feat: upgrade to Go 1.13. Closes argoproj#1375 (argoproj#2097)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Feb 12, 2020
1 parent 7466efa commit 2672857
Show file tree
Hide file tree
Showing 26 changed files with 998 additions and 2,278 deletions.
43 changes: 17 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,37 @@ commands:
- run:
name: Install Kustomize
command: cd /usr/local/bin && curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | sudo bash
dep_ensure:
restore_go_mod:
steps:
- run:
name: Install Dep v0.5.3
command: DEP_RELEASE_TAG=v0.5.3 curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- restore_cache:
name: Restore vendor cache
name: Restore go mod cache
keys:
- vendor-v6-{{ checksum "Gopkg.lock" }}-{{ .Environment.CIRCLE_JOB }}
- run:
name: Ensure dependencies
command: |
# dep ensure takes 5m, but is only needed if not cached
[[ -e vendor ]] || make vendor && touch vendor
- go-mod-v1-{{ checksum "go.sum" }}-{{ .Environment.CIRCLE_JOB }}
save_go_mod:
steps:
- save_cache:
name: Save vendor cache
key: vendor-v6-{{ checksum "Gopkg.lock" }}-{{ .Environment.CIRCLE_JOB }}
name: Save go mod cache
key: go-mod-v1-{{ checksum "go.sum" }}-{{ .Environment.CIRCLE_JOB }}
paths:
- vendor
- /home/circleci/.go_workspace/go/pkg/mod
when: always
install_golang:
steps:
- run:
name: Install Golang v1.12.6
name: Install Golang v1.13.4
command: |
go get golang.org/dl/go1.12.6
[ -e /home/circleci/sdk/go1.12.6 ] || go1.12.6 download
go get golang.org/dl/go1.13.4
[ -e /home/circleci/sdk/go1.13.4 ] || go1.13.4 download
echo "export GOPATH=/home/circleci/.go_workspace" | tee -a $BASH_ENV
echo "export PATH=/home/circleci/sdk/go1.12.6/bin:\$PATH" | tee -a $BASH_ENV
echo "export PATH=/home/circleci/sdk/go1.13.4/bin:\$PATH" | tee -a $BASH_ENV
save_go_cache:
steps:
- save_cache:
name: Save Golang cache
key: go-v5-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}
paths:
- /home/circleci/.cache/go-build
- /home/circleci/sdk/go1.12.6
- /home/circleci/sdk/go1.13.4
when: always
restore_go_cache:
steps:
Expand All @@ -50,8 +44,6 @@ commands:
keys:
- go-v5-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}
- go-v5-master-{{ .Environment.CIRCLE_JOB }}
- go-v4-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}
- go-v4-master-{{ .Environment.CIRCLE_JOB }}
e2e:
steps:
- install_kustomize
Expand All @@ -63,7 +55,7 @@ commands:
- install_golang
- go_junit_report
- checkout
- dep_ensure
- restore_go_mod
- run:
name: Create KUBECONFIG
# Copy kubeconfig file, and add a fake user for "argo --token xxx" testing
Expand Down Expand Up @@ -108,6 +100,7 @@ commands:
mkdir -p test-results
trap 'go-junit-report < test-results/test.out > test-results/junit.xml' EXIT
make test-e2e 2>&1 | tee test-results/test.out
- save_go_mod
- save_go_cache
- store_test_results:
path: test-results
Expand All @@ -130,17 +123,15 @@ jobs:
- install_golang
- go_junit_report
- checkout
- dep_ensure
- restore_go_mod
- run:
name: Run tests
command: |
mkdir -p test-results
trap 'go-junit-report < test-results/test.out > test-results/junit.xml' EXIT
make test 2>&1 | tee test-results/test.out
- run:
name: Verify code generation
command: make verify-codegen verify-manifests
- save_go_cache
- save_go_mod
- run:
name: Uploading code coverage
command: bash <(curl -s https://codecov.io/bash) -f coverage.out
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cmd/**/debug
hack/**/debug
/argo
/argoexec
/sdks
debug.test
*.iml
/coverage.out
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Initial stage which pulls prepares build dependencies and CLI tooling we need for our final image
# Also used as the image in CI jobs so needs all dependencies
####################################################################################################
FROM golang:1.11.5 as builder
FROM golang:1.13.4 as builder

RUN apt-get update && apt-get install -y \
git \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Initial stage which pulls prepares build dependencies and CLI tooling we need for our final image
# Also used as the image in CI jobs so needs all dependencies
####################################################################################################
FROM golang:1.11.5 as builder
FROM golang:1.13.4 as builder

RUN apt-get update && apt-get install -y \
git \
Expand Down
Loading

0 comments on commit 2672857

Please sign in to comment.