[gnome-keyring/wip/dueno/ci-fixes] .gitlab-ci.yml: Run tests as a regular user




commit 4964886a0222874367c41e051365fd822d62f44e
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 | 87 +++++++++++++++++++++++++++++-----------------------------
 1 file changed, 44 insertions(+), 43 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0b5b52ab..58ef1663 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,68 +5,69 @@ stages:
 variables:
   DEPENDENCIES: dbus-x11 gcc gnome-common gtk-doc make openssh python redhat-rpm-config
 
-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
+  artifacts:
+    paths:
+      - test-suite.log
+
+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
+  extends: .build
   before_script:
-    - dnf install -y 'dnf-command(builddep)'
-    - dnf builddep -y gnome-keyring
-    - dnf install -y $DEPENDENCIES libasan
-    - dbus-uuidgen --ensure
+    - dnf install -y libasan
   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
-  artifacts:
-    paths:
-      - test-suite.log
+    - 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 -- make -j$(nproc) V=1 DISABLE_HARD_ERRORS=1 
XFAIL_TESTS="\$(JS_TESTS) \$(PY_TESTS)" check
 
 fedora:ubsan:
-  image: fedora:latest
-  stage: build
+  extends: .build
   before_script:
-    - dnf install -y 'dnf-command(builddep)'
-    - dnf builddep -y gnome-keyring
-    - dnf install -y $DEPENDENCIES libubsan
-    - dbus-uuidgen --ensure
+    - dnf install -y libubsan
   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
-  artifacts:
-    paths:
-      - test-suite.log
+    - 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 -- make -j$(nproc) V=1 check
 
 fedora:coverage:
-  image: fedora:latest
-  stage: build
+  extends: .build
   before_script:
-    - dnf install -y 'dnf-command(builddep)'
-    - dnf builddep -y gnome-keyring
-    - dnf install -y $DEPENDENCIES lcov
-    - dbus-uuidgen --ensure
+    - dnf install -y lcov
   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]