X-Git-Url: https://ruderich.org/simon/gitweb/?p=nsscash%2Fnsscash.git;a=blobdiff_plain;f=.gitlab-ci.yml;h=c43c98351cffaa8043979af139df2a1e8fc637d4;hp=6442ec4a4592a6095b8f0e3da12a2eb0311fd318;hb=HEAD;hpb=6f8646c1e90bbe0624ff28f1d3263f2b6b17c8ea diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6442ec4..9d8b58c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,22 +1,20 @@ .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= + variables: + # The chown to nobody above causes permissions errors in recent Git + # versions "fatal: detected dubious ownership in repository [...] To add + # an exception for this directory, call: git config --global --add + # safe.directory [...]". + GIT_STRATEGY: clone debian-stable: <<: *template-docker