|
@@ -1,4 +1,4 @@
|
|
|
-#!/bin/bash
|
|
|
|
|
|
|
+#!/usr/bin/env bash
|
|
|
|
|
|
|
|
COVERAGE_FILE=${PWD}/coverage.txt
|
|
COVERAGE_FILE=${PWD}/coverage.txt
|
|
|
COV_SORTED=${PWD}/coverallsorted.out
|
|
COV_SORTED=${PWD}/coverallsorted.out
|
|
@@ -19,8 +19,7 @@ if [ -f "${TEST_FILES[0]}" ]; then
|
|
|
test_package ""
|
|
test_package ""
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
-# shellcheck disable=SC2044
|
|
|
|
|
-for DIR in $(find ./* -type d ! -path "*.git*" ! -path "*vendor*" ! -path "*external*"); do
|
|
|
|
|
|
|
+for DIR in $(find ./* -type d ! -path "*.git*"); do
|
|
|
TEST_FILES=("$DIR"/*_test.go)
|
|
TEST_FILES=("$DIR"/*_test.go)
|
|
|
if [ -f "${TEST_FILES[0]}" ]; then
|
|
if [ -f "${TEST_FILES[0]}" ]; then
|
|
|
test_package "/$DIR"
|
|
test_package "/$DIR"
|
|
@@ -34,7 +33,7 @@ do
|
|
|
< "${OUT_FILE}" grep -v "mode: set" >> "$COVERAGE_FILE"
|
|
< "${OUT_FILE}" grep -v "mode: set" >> "$COVERAGE_FILE"
|
|
|
done < <(find ./* -name "*.out" -print0)
|
|
done < <(find ./* -name "*.out" -print0)
|
|
|
|
|
|
|
|
-< "$COVERAGE_FILE" sort -t: -k1 | grep -vw "testing" | grep -v ".pb.go" | grep -vw "vendor" | grep -vw "external" > "$COV_SORTED"
|
|
|
|
|
|
|
+< "$COVERAGE_FILE" sort -t: -k1 | grep -vw "testing" | grep -v ".pb.go" > "$COV_SORTED"
|
|
|
echo "mode: set" | cat - "${COV_SORTED}" > "${COVERAGE_FILE}"
|
|
echo "mode: set" | cat - "${COV_SORTED}" > "${COVERAGE_FILE}"
|
|
|
|
|
|
|
|
-bash <(curl -s https://codecov.io/bash) || echo 'Codecov failed to upload'
|
|
|
|
|
|
|
+bash <(curl -s https://codecov.io/bash) || echo 'Codecov failed to upload'
|