From 4403833dcfc3d296dd9664b1752f722e5f64a275 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 15 Dec 2019 11:22:07 +0100 Subject: [PATCH] .gitlab-ci.yml: use ci/run and switch to GOPATH-less build The ca-certificates package is required for connections to proxy.golang.org --- .gitlab-ci.yml | 12 ++---------- ci/run | 13 +++++++++---- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6442ec4..c43c983 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,22 +1,14 @@ .template-docker: &template-docker before_script: - apt-get update - - apt-get install --no-install-recommends --yes golang golang-golang-x-tools golang-github-pkg-errors-dev golang-github-burntsushi-toml-dev build-essential clang git + - apt-get install --no-install-recommends --yes golang golang-golang-x-tools build-essential clang git ca-certificates script: - - 'test -z "$GOPATH" && export GOPATH=/usr/share/gocode' # Run as user nobody so CAP_DAC_OVERRIDE is dropped and the tests can # chmod a file 0000 to force "permission denied" errors. - export HOME=/tmp # writable by nobody - chown -R nobody . # Empty TEST_* as -fsanitize doesn't work in a Docker container - - runuser -p -u nobody -- make TEST_CFLAGS= TEST_LDFLAGS= - - runuser -p -u nobody -- make test TEST_CFLAGS= TEST_LDFLAGS= - - 'test -z "$(git clean -nd)"' # any untracked files left? - - runuser -p -u nobody -- make clean - - 'test -z "$(git clean -ndx)"' # any unignored files left? - # Build with clang - - runuser -p -u nobody -- make CC=clang TEST_CFLAGS= TEST_LDFLAGS= - - runuser -p -u nobody -- make test CC=clang TEST_CFLAGS= TEST_LDFLAGS= + - runuser -p -u nobody -- ./ci/run TEST_CFLAGS= TEST_LDFLAGS= debian-stable: <<: *template-docker diff --git a/ci/run b/ci/run index 7217067..d4bd6f5 100755 --- a/ci/run +++ b/ci/run @@ -4,13 +4,18 @@ set -eu set -x -make -make test +flags= +if test $# -ne 0; then + flags="$*" +fi + +make $flags +make test $flags test -z "$(git clean -nd)" # any untracked files left? make clean test -z "$(git clean -ndx)" # any unignored files left? # Build with clang -make CC=clang -make test CC=clang +make CC=clang $flags +make test CC=clang $flags -- 2.43.2