Merge pull request #5471 from adamreese/v3/ci-refactor

ref(circleci): refactor ci setup
pull/5469/head
Adam Reese 6 years ago committed by GitHub
commit 927ab601cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,19 +0,0 @@
#!/usr/bin/env bash
# Copyright The Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -euo pipefail
apt-get update -y && apt-get install -yq zip
make bootstrap

@ -1,41 +1,42 @@
---
version: 2 version: 2
jobs: jobs:
build: build:
working_directory: /go/src/helm.sh/helm working_directory: /go/src/helm.sh/helm
parallelism: 3 parallelism: 3
docker: docker:
- image: circleci/golang:1.12 - image: circleci/golang:1.12
environment: environment:
- PROJECT_NAME: "kubernetes-helm" - PROJECT_NAME: "kubernetes-helm"
- GOCACHE: "/tmp/go/cache" - GOCACHE: "/tmp/go/cache"
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
key: gopkg-{{ .Branch }}-{{ checksum "Gopkg.lock" }} key: gopkg-{{ checksum "Gopkg.lock" }}
paths:
- /go/src/helm.sh/helm/vendor
- run:
name: install dependencies
command: .circleci/bootstrap.sh
- save_cache:
key: gopkg-{{ .Branch }}-{{ checksum "Gopkg.lock" }}
paths:
- /go/src/helm.sh/helm/vendor
- restore_cache: - restore_cache:
keys: keys:
- build-cache-{{ .Branch }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }} - build-cache-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
paths:
- /tmp/go/cache
- run: - run:
name: test name: test
command: .circleci/test.sh command: make test-coverage
- save_cache:
key: gopkg-{{ checksum "Gopkg.lock" }}
paths:
- /go/src/helm.sh/helm/vendor
- /go/pkg/dep
- save_cache: - save_cache:
key: build-cache-{{ .Branch }}-{{ .Environment.CIRCLE_BUILD_NUM }} key: build-cache-{{ .Environment.CIRCLE_BUILD_NUM }}
paths: paths:
- /tmp/go/cache - /tmp/go/cache
- deploy: - deploy:
name: deploy name: deploy
command: .circleci/deploy.sh command: .circleci/deploy.sh
workflows: workflows:
version: 2 version: 2
build: build:

@ -70,6 +70,12 @@ test-unit: vendor
@echo "==> Running unit tests <==" @echo "==> Running unit tests <=="
HELM_HOME=/no_such_dir go test $(GOFLAGS) -run $(TESTS) $(PKG) $(TESTFLAGS) HELM_HOME=/no_such_dir go test $(GOFLAGS) -run $(TESTS) $(PKG) $(TESTFLAGS)
.PHONY: test-coverage
test-coverage: vendor
@echo
@echo "==> Running unit tests with coverage <=="
@ HELM_HOME=/no_such_dir ./scripts/coverage.sh
.PHONY: test-style .PHONY: test-style
test-style: vendor $(GOLANGCI_LINT) test-style: vendor $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run $(GOLANGCI_LINT) run

Loading…
Cancel
Save