Merge pull request #1032 from grahamwhaley/20200430_travis

CI: enable Travis static checks
This commit is contained in:
Salvador Fuentes
2020-05-28 11:07:02 -05:00
committed by GitHub
4 changed files with 66 additions and 9 deletions

34
.ci/lib.sh Normal file
View File

@@ -0,0 +1,34 @@
#
# Copyright (c) 2018,2020 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
if [ -n "${TRAVIS_BRANCH:-}" ]; then
( cd "${tests_repo_dir}" && git checkout "${TRAVIS_BRANCH}" )
fi
}
run_static_checks()
{
clone_tests_repo
bash "$tests_repo_dir/.ci/static-checks.sh" "github.com/kata-containers/packaging"
}
run_go_test()
{
clone_tests_repo
bash "$tests_repo_dir/.ci/go-test.sh"
}

View File

@@ -1,14 +1,13 @@
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
# Copyright (c) 2018,2020 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
set -o errexit
set -o nounset
set -o pipefail
set -e
# This script should run any static analysis check
# It is called by the CI setup
true
cidir=$(dirname "$0")
source "${cidir}/lib.sh"
# Run static checks
run_static_checks

24
.travis.yml Normal file
View File

@@ -0,0 +1,24 @@
#
# Copyright 2017 HyperHQ Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
sudo: required
dist: bionic
os:
- linux
- linux-ppc64le
language: go
go_import_path: github.com/kata-containers/packaging
env:
- target_branch=$TRAVIS_BRANCH
before_script:
- ".ci/setup.sh"
script:
- bash .ci/static-checks.sh github.com/kata-containers/packaging

View File

@@ -258,7 +258,7 @@ func main() {
logrus.WithFields(logrus.Fields{
"OBS project": proj.Name,
"Packagecloud Repo": pc.Repo,
}).Infof("Sucessfully transferred %d files", totalXferred)
}).Infof("Successfully transferred %d files", totalXferred)
}
if !*pcDelete {