github.com/umeshredd/helm@v3.0.0-alpha.1+incompatible/.circleci/test.sh (about) 1 #!/usr/bin/env bash 2 3 # Copyright The Helm Authors. 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # See the License for the specific language governing permissions and 15 # limitations under the License. 16 17 # Bash 'Strict Mode' 18 # http://redsymbol.net/articles/unofficial-bash-strict-mode 19 set -euo pipefail 20 IFS=$'\n\t' 21 22 HELM_ROOT="${BASH_SOURCE[0]%/*}/.." 23 cd "$HELM_ROOT" 24 25 mkdir -p "${GOCACHE:-/tmp/go/cache}" 26 27 run_unit_test() { 28 if [[ "${CIRCLE_BRANCH-}" == "master" ]]; then 29 echo "Running unit tests with coverage'" 30 ./scripts/coverage.sh --coveralls 31 else 32 echo "Running 'unit tests'" 33 make test-unit 34 fi 35 } 36 37 run_style_check() { 38 echo "Running 'make test-style'" 39 make test-style 40 } 41 42 # Build to ensure packages are compiled 43 echo "Running 'make build'" 44 make build 45 46 case "${CIRCLE_NODE_INDEX-0}" in 47 0) run_unit_test ;; 48 1) run_style_check ;; 49 esac