k3s/scripts/validate
Derek Nola 7242ce9316
Redux: Add Unit Test Coverage to CI (#3524)
* Added Github action to run unit tests and connect to Codecov

Signed-off-by: dereknola <derek.nola@suse.com>
2021-06-29 11:27:50 -07:00

35 lines
549 B
Bash
Executable File

#!/bin/bash
set -e
cd $(dirname $0)/..
GO=${GO-go}
if ! command -v golangci-lint; then
echo Skipping validation: no golangci-lint available
exit
fi
echo Running validation
if [ ! -e build/data ];then
mkdir -p build/data
fi
echo Running: "${GO}" generate
"${GO}" generate
echo Running: golangci-lint
golangci-lint run -v
GO111MODULE=on go mod tidy
GO111MODULE=on go mod vendor
. ./scripts/version.sh
if [ -n "$DIRTY" ]; then
echo Source dir is dirty
git status --porcelain --untracked-files=no
git diff
exit 1
fi