diff --git a/.ci/lib.sh b/.ci/lib.sh new file mode 100644 index 0000000000..47eacc2d06 --- /dev/null +++ b/.ci/lib.sh @@ -0,0 +1,25 @@ +# +# Copyright (c) 2019 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +export tests_repo="${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" "github.com/kata-containers/community" +} diff --git a/.ci/run.sh b/.ci/run.sh new file mode 100755 index 0000000000..951be64148 --- /dev/null +++ b/.ci/run.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# +# Copyright (c) 2019 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +# No explicit tests currently +true diff --git a/.ci/setup.sh b/.ci/setup.sh new file mode 100755 index 0000000000..26c895bab1 --- /dev/null +++ b/.ci/setup.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# Copyright (c) 2019 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +cidir=$(dirname "$0") +source "${cidir}/lib.sh" + +clone_tests_repo + +pushd "${tests_repo_dir}" +.ci/setup.sh +popd diff --git a/.ci/static-checks.sh b/.ci/static-checks.sh new file mode 100755 index 0000000000..b3f69aa95d --- /dev/null +++ b/.ci/static-checks.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# +# Copyright (c) 2019 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +set -e + +cidir=$(dirname "$0") +source "${cidir}/lib.sh" + +run_static_checks diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..38b6e496f2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +# +# Copyright (c) 2019 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +dist: xenial + +language: go + +go: + - master + +before_install: + - ".ci/setup.sh" + +before_script: + - ".ci/static-checks.sh" + +script: + - ".ci/run.sh"