-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
245 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
version: 2 | ||
|
||
integration-test-environment: &integration-test-environment | ||
GO_VERSION: "1.12.5" | ||
KUBECONFIG: /home/circleci/.kube/config | ||
MINIKUBE_VERSION: v1.1.0 | ||
MINIKUBE_WANTUPDATENOTIFICATION: false | ||
MINIKUBE_WANTREPORTERRORPROMPT: false | ||
MINIKUBE_HOME: /home/circleci | ||
CHANGE_MINIKUBE_NONE_USER: true | ||
GOPATH: /go | ||
DOCKER_LATEST: 1 | ||
GIN_MODE: release | ||
|
||
integration-test-base: &integration-test-base | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
docker_layer_caching: true | ||
steps: | ||
- run: | ||
name: Setup minikube | ||
command: | | ||
curl -Lo minikube https://github.com/kubernetes/minikube/releases/download/${MINIKUBE_VERSION}/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ | ||
- run: | ||
name: Start minikube | ||
background: true | ||
command: | | ||
sudo -E minikube start --vm-driver=none --cpus 2 --memory 4096 --kubernetes-version=${K8S_VERSION} | ||
- run: | ||
name: Setup kubectl | ||
command: | | ||
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ | ||
mkdir -p ${HOME}/.kube | ||
touch ${HOME}/.kube/config | ||
- checkout | ||
|
||
- run: | ||
name: Create go directory | ||
command: | | ||
sudo mkdir /go | ||
sudo chmod 777 /go | ||
- restore_cache: | ||
name: Restore Go module cache | ||
keys: | ||
- gomod-v2-{{ .Branch }}-{{ checksum "go.sum" }} | ||
- gomod-v2-{{ .Branch }} | ||
- gomod-v2-master | ||
- gomod-v2 | ||
|
||
- run: | ||
name: Setup golang | ||
command: | | ||
sudo rm -rf /usr/local/go | ||
curl -Lo go.linux-amd64.tar.gz https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && sudo tar -C /usr/local -xzf go.linux-amd64.tar.gz && rm go.linux-amd64.tar.gz | ||
- run: | ||
name: Wait for minikube | ||
command: | | ||
timeout 180s bash <<EOT | ||
set -o pipefail | ||
function is_ready() | ||
{ | ||
kubectl get nodes -o json \ | ||
| jq '.items[].status.conditions[] | select(.type=="Ready" and .status=="True")' | ||
} | ||
until is_ready | ||
do | ||
sleep 1 | ||
done | ||
EOT | ||
- run: | ||
name: Integration test | ||
command: | ||
make test-integration | ||
|
||
|
||
jobs: | ||
check: | ||
docker: | ||
- image: circleci/golang:1.12 | ||
environment: | ||
GOFLAG: -mod=readonly | ||
|
||
resource_class: small | ||
|
||
steps: | ||
- checkout | ||
|
||
- restore_cache: | ||
name: Restore Go module cache | ||
keys: | ||
- gomod-v2-{{ .Branch }}-{{ checksum "go.sum" }} | ||
- gomod-v2-{{ .Branch }} | ||
- gomod-v2-master | ||
- gomod-v2 | ||
|
||
- run: | ||
name: Install dependencies | ||
command: go mod download | ||
|
||
- save_cache: | ||
name: Save Go module cache | ||
key: gomod-v2-{{ .Branch }}-{{ checksum "go.sum" }} | ||
paths: | ||
- /go/pkg/mod | ||
# | ||
# - restore_cache: | ||
# name: Restore license cache | ||
# keys: | ||
# - licensei-v2-{{ .Branch }}-{{ checksum "go.sum" }} | ||
# - licensei-v2-{{ .Branch }} | ||
# - licensei-v2-master | ||
# - licensei-v2 | ||
# | ||
# - run: | ||
# name: Download license information for dependencies | ||
# command: make license-cache | ||
# | ||
# - save_cache: | ||
# name: Save license cache | ||
# key: licensei-v2-{{ .Branch }}-{{ checksum "go.sum" }} | ||
# paths: | ||
# - .licensei.cache | ||
# | ||
# - run: | ||
# name: Check dependency licenses | ||
# command: make license-check | ||
|
||
- run: | ||
name: Run verification | ||
command: make | ||
|
||
integration-test-k8s1-14: | ||
<<: *integration-test-base | ||
environment: | ||
<<: *integration-test-environment | ||
K8S_VERSION: v1.14.2 | ||
|
||
integration-test-k8s1-13: | ||
<<: *integration-test-base | ||
environment: | ||
<<: *integration-test-environment | ||
K8S_VERSION: v1.13.6 | ||
|
||
integration-test-k8s1-12: | ||
<<: *integration-test-base | ||
environment: | ||
<<: *integration-test-environment | ||
K8S_VERSION: v1.12.9 | ||
|
||
workflows: | ||
version: 2 | ||
ci: | ||
jobs: | ||
- check | ||
- integration-test-k8s1-14: | ||
requires: | ||
- check | ||
- integration-test-k8s1-13: | ||
requires: | ||
- check | ||
- integration-test-k8s1-12: | ||
requires: | ||
- check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.