CI: Enable checkcommits

Run the central static check script to enable `checkcommits`.

Fixes #8.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt
2018-01-30 14:48:06 +00:00
parent 71f5b11b9a
commit 1c488951e0
3 changed files with 62 additions and 0 deletions

25
.ci/lib.sh Normal file
View File

@@ -0,0 +1,25 @@
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
export tests_repo="github.com/kata-containers/tests"
export tests_repo_dir="$GOPATH/src/$tests_repo"
clone_tests_repo()
{
# KATA_CI_NO_NETWORK is (has to be) ignored if there is
# no existing clone.
if [ -d "$tests_repo_dir" -a -n "$KATA_CI_NO_NETWORK" ]
then
return
fi
go get -d -u "$tests_repo" || true
}
run_static_checks()
{
clone_tests_repo
bash "$tests_repo_dir/.ci/static-checks.sh"
}

12
.ci/static-checks.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
set -e
cidir=$(dirname "$0")
source "${cidir}/lib.sh"
run_static_checks

25
.travis.yml Normal file
View File

@@ -0,0 +1,25 @@
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
sudo: required
dist: trusty
language: go
env:
- KATA_RUNTIME=cc
- KATA_RUNTIME=runv
go:
- 1.8
before_script:
- ".ci/static-checks.sh"
install:
- cd ${TRAVIS_BUILD_DIR}
- make KATA_RUNTIME=${KATA_RUNTIME}
- sudo -E PATH=$PATH make KATA_RUNTIME=${KATA_RUNTIME} install