diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2018-05-16 12:11:08 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2018-06-25 12:06:21 +0200 |
commit | 74ac3094062d1c7544413b9f38acb44206e30252 (patch) | |
tree | ceabb90d27a213795dac1d8a551904dbd6f9661d | |
parent | 90de65bb3fbacbc8a1443161c212c7ecbadfab1a (diff) |
Run tests on GitLab CI
Salsa has support for GitLab CI. This introduces a test setup
for it, derived from the ones for shippable and travis. It is
not optimal yet: The build is run in the test stage. Fixing this
requires us to separate test from build dependencies, and storing
build/ as an artifact of the build stage; since build and test
stage run on different runners with fresh checkouts and images.
(cherry picked from commit 8cc38267809a15ec9819bce721e52fcd90a523b9)
-rw-r--r-- | .gitlab-ci.yml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..0ebff095c --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,33 @@ +image: debian:testing + +test as root: + stage: test + script: + - adduser --home /home/travis travis --quiet --disabled-login --gecos "" --uid 1000 + - rm -f /etc/dpkg/dpkg.cfg.d/excludes + - apt-get update + - apt-get install -qq build-essential expect gcovr sudo + - chmod -R o+rwX $PWD + - ./prepare-release travis-ci + - sudo -u travis mkdir build + - sudo -u travis env -C build cmake -DCMAKE_BUILD_TYPE=Coverage -G Ninja .. + - sudo -u travis ninja -C build + - CTEST_OUTPUT_ON_FAILURE=1 ninja -C build test + - unbuffer ./test/integration/run-tests -q -j 4 + - gcovr + +test as user: + stage: test + script: + - adduser --home /home/travis travis --quiet --disabled-login --gecos "" --uid 1000 + - rm -f /etc/dpkg/dpkg.cfg.d/excludes + - apt-get update + - apt-get install -qq build-essential expect gcovr sudo + - chmod -R o+rwX $PWD + - ./prepare-release travis-ci + - sudo -u travis mkdir build + - sudo -u travis env -C build cmake -DCMAKE_BUILD_TYPE=Coverage -G Ninja .. + - sudo -u travis ninja -C build + - sudo -u travis CTEST_OUTPUT_ON_FAILURE=1 ninja -C build test + - sudo -u travis unbuffer ./test/integration/run-tests -q -j 4 + - sudo -u travis gcovr |