Skip to content

Commit

Permalink
Merge pull request #2736 from dgageot/fix-ci
Browse files Browse the repository at this point in the history
Fix CI scripts
  • Loading branch information
balopat authored Aug 28, 2019
2 parents bbe58e9 + 4ab8f39 commit dc6d62e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
13 changes: 3 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,12 @@ jobs:
name: "Linux unit"
script:
- make
- make quicktest
after_success:
- bash <(curl -s https://codecov.io/bash)
- make coverage
- os: osx
name: "OSX unit"
env:
- GO111MODULE=on
- GOFLAGS="-mod=vendor"
script:
- go build -o out/skaffold cmd/skaffold/skaffold.go
- go test -short -timeout 60s ./...
after_success:
- bash <(curl -s https://codecov.io/bash)
- make
- make quicktest
- os: windows
name: "Windows unit"
env:
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ cross: $(foreach platform, $(SUPPORTED_PLATFORMS), $(BUILD_DIR)/$(PROJECT)-$(pla
.PHONY: test
test: $(BUILD_DIR)
@ ./hack/test.sh
@ ./hack/checks.sh

.PHONY: coverage
coverage: $(BUILD_DIR)
@ ./hack/test.sh
@ curl -s https://codecov.io/bash > $(BUILD_DIR)/upload_coverage
@ bash $(BUILD_DIR)/upload_coverage

.PHONY: checks
checks: $(BUILD_DIR)
Expand Down
8 changes: 6 additions & 2 deletions hack/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

RED='\033[0;31m'
GREEN='\033[0;32m'
RESET='\033[0m'

echo "Running validation scripts..."
scripts=(
"hack/boilerplate.sh"
Expand All @@ -26,10 +30,10 @@ scripts=(
fail=0
for s in "${scripts[@]}"; do
echo "RUN ${s}"
set +e

./$s
result=$?
set -e

if [[ $result -eq 0 ]]; then
echo -e "${GREEN}PASSED${RESET} ${s}"
else
Expand Down
8 changes: 1 addition & 7 deletions hack/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@
set -e

RED='\033[0;31m'
GREEN='\033[0;32m'
RESET='\033[0m'

echo "Running go tests..."
go test -count=1 -race -cover -short -timeout=60s -coverprofile=out/coverage.txt -coverpkg="./pkg/...,./cmd/..." ./... | awk -v FAIL="${RED}FAIL${RESET}" '! /no test files/ { gsub("FAIL", FAIL, $0); print $0 }'

GO_TEST_EXIT_CODE=${PIPESTATUS[0]}
if [[ $GO_TEST_EXIT_CODE -ne 0 ]]; then
exit $GO_TEST_EXIT_CODE
fi

hack/checks.sh
exit ${PIPESTATUS[0]}

0 comments on commit dc6d62e

Please sign in to comment.