CI: Add CI scripts

Add a basic set of CI scripts to ensure doc PRs are checked.

Fixes: #112.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt 2019-08-29 16:25:16 +01:00
parent d45df3fae1
commit f11c7bb05f
5 changed files with 86 additions and 0 deletions

25
.ci/lib.sh Normal file
View File

@ -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"
}

11
.ci/run.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
# No explicit tests currently
true

17
.ci/setup.sh Executable file
View File

@ -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

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

@ -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

21
.travis.yml Normal file
View File

@ -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"