[gnome-keyring/wip/dueno/ci-fixes: 1/2] .gitlab-ci.yml: Run tests as a regular user
- From: Daiki Ueno <dueno src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring/wip/dueno/ci-fixes: 1/2] .gitlab-ci.yml: Run tests as a regular user
- Date: Fri, 26 Mar 2021 16:00:14 +0000 (UTC)
commit a8b3bbf945b7f131deb982f7ed7e27cb1f9213f4
Author: Daiki Ueno <dueno src gnome org>
Date: Fri Mar 26 16:31:45 2021 +0100
.gitlab-ci.yml: Run tests as a regular user
.gitlab-ci.yml | 80 ++++++++++++++++++++++++++++------------------------------
1 file changed, 39 insertions(+), 41 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0b5b52ab..16d06b54 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,70 +3,68 @@ stages:
- deploy
variables:
- DEPENDENCIES: dbus-x11 gcc gnome-common gtk-doc make openssh python redhat-rpm-config
+ DEPENDENCIES: dbus-x11 gcc gnome-common gtk-doc make openssh python redhat-rpm-config lcov libasan libubsan
-fedora:Werror:
- image: fedora:latest
+.build:
stage: build
+ image: fedora:latest
before_script:
- dnf install -y 'dnf-command(builddep)'
- dnf builddep -y gnome-keyring
- dnf install -y $DEPENDENCIES
- dbus-uuidgen --ensure
+ - useradd user
+
+fedora:Werror:
+ extends: .build
script:
- - ./autogen.sh --disable-dependency-tracking --enable-gtk-doc --enable-strict
CFLAGS="-Wno-error=deprecated-declarations"
- - make -j$(nproc) V=1
- - eval `dbus-launch --sh-syntax`
- - make -j$(nproc) V=1 distcheck
+ - NOCONFIGURE=1 ./autogen.sh
+ - mkdir _build
+ - chown user _build
+ - cd _build
+ - runuser -u user -- ../configure --disable-dependency-tracking --enable-gtk-doc --enable-strict
CFLAGS="-Wno-error=deprecated-declarations"
+ - runuser -u user -- make -j$(nproc) V=1
+ - eval `runuser -u user -- dbus-launch --sh-syntax`
+ - runuser -u user -- make -j$(nproc) V=1 distcheck
fedora:asan:
- image: fedora:latest
- stage: build
- before_script:
- - dnf install -y 'dnf-command(builddep)'
- - dnf builddep -y gnome-keyring
- - dnf install -y $DEPENDENCIES libasan
- - dbus-uuidgen --ensure
+ extends: .build
script:
- - ./autogen.sh --disable-dependency-tracking CFLAGS='-fsanitize=address -g -fno-common
-U_FORTIFY_SOURCE' CXXFLAGS='-fsanitize=address -g -fno-common -U_FORTIFY_SOURCE' LDFLAGS='-fsanitize=address
-g -fno-common -U_FORTIFY_SOURCE' LIBS='-lasan -ldl -lpthread'
- - make -j$(nproc) V=1
- - eval `dbus-launch --sh-syntax`
- - LSAN_OPTIONS=exitcode=0 make -j$(nproc) V=1 DISABLE_HARD_ERRORS=1 XFAIL_TESTS="\$(JS_TESTS)
\$(PY_TESTS)" check
+ - runuser -u user -- ../configure --disable-dependency-tracking CFLAGS='-fsanitize=address -g
-fno-common -U_FORTIFY_SOURCE' CXXFLAGS='-fsanitize=address -g -fno-common -U_FORTIFY_SOURCE'
LDFLAGS='-fsanitize=address -g -fno-common -U_FORTIFY_SOURCE' LIBS='-lasan -ldl -lpthread'
+ - runuser -u user -- make -j$(nproc) V=1
+ - eval `runuser -u user -- dbus-launch --sh-syntax`
+ - LSAN_OPTIONS=exitcode=0 runuser -u user -- make -j$(nproc) V=1 DISABLE_HARD_ERRORS=1
XFAIL_TESTS="\$(JS_TESTS) \$(PY_TESTS)" check
artifacts:
paths:
- test-suite.log
fedora:ubsan:
- image: fedora:latest
- stage: build
- before_script:
- - dnf install -y 'dnf-command(builddep)'
- - dnf builddep -y gnome-keyring
- - dnf install -y $DEPENDENCIES libubsan
- - dbus-uuidgen --ensure
+ extends: .build
script:
- - ./autogen.sh --disable-dependency-tracking CFLAGS='-fsanitize=undefined -g -fno-common
-U_FORTIFY_SOURCE' CXXFLAGS='-fsanitize=undefined -g -fno-common -U_FORTIFY_SOURCE'
LDFLAGS='-fsanitize=undefined -g -fno-common -U_FORTIFY_SOURCE' LIBS='-lubsan -ldl -lpthread'
- - make -j$(nproc) V=1
- - eval `dbus-launch --sh-syntax`
- - make -j$(nproc) V=1 check
+ - NOCONFIGURE=1 ./autogen.sh
+ - mkdir _build
+ - chown user _build
+ - cd _build
+ - runuser -u user -- ../configure --disable-dependency-tracking CFLAGS='-fsanitize=undefined -g
-fno-common -U_FORTIFY_SOURCE' CXXFLAGS='-fsanitize=undefined -g -fno-common -U_FORTIFY_SOURCE'
LDFLAGS='-fsanitize=undefined -g -fno-common -U_FORTIFY_SOURCE' LIBS='-lubsan -ldl -lpthread'
+ - runuser -u user -- make -j$(nproc) V=1
+ - eval `runuser -u user -- dbus-launch --sh-syntax`
+ - runuser -u user -- make -j$(nproc) V=1 check
artifacts:
paths:
- test-suite.log
fedora:coverage:
- image: fedora:latest
- stage: build
- before_script:
- - dnf install -y 'dnf-command(builddep)'
- - dnf builddep -y gnome-keyring
- - dnf install -y $DEPENDENCIES lcov
- - dbus-uuidgen --ensure
+ extends: .build
script:
- - ./autogen.sh --disable-dependency-tracking --enable-coverage
- - make -j$(nproc) V=1
- - eval `dbus-launch --sh-syntax`
- - make -j$(nproc) V=1 check
- - make coverage
+ - NOCONFIGURE=1 ./autogen.sh
+ - mkdir _build
+ - chown user _build
+ - cd _build
+ - runuser -u user -- ../configure --disable-dependency-tracking --enable-coverage
+ - runuser -u user -- make -j$(nproc) V=1
+ - eval `runuser -u user -- dbus-launch --sh-syntax`
+ - runuser -u user -- make -j$(nproc) V=1 check
+ - runuser -u user -- make coverage
coverage: '/^\s+lines.+:\s+([\d.]+\%)\s+/'
artifacts:
name: "gnome-keyring-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]