add .gitlab-ci-coverage.yml for a scheduled build
authorStefan Metzmacher <metze@samba.org>
Tue, 29 Dec 2020 14:15:13 +0000 (15:15 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 13 Apr 2021 09:33:14 +0000 (09:33 +0000)
This will be used by the https://gitlab.com/samba-team/samba
configuration, while https://gitlab.com/samba-team/devel/samba
will still use .gitlab-ci.yml (via the legacy .gitlab-ci-private.yml).

The key point is the usage of the more powerful n1-standard-2
runners for testing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Apr 13 09:33:14 UTC 2021 on sn-devel-184

.gitlab-ci-coverage-runners.yml [new file with mode: 0644]
.gitlab-ci-coverage.yml [new file with mode: 0644]
.gitlab-ci-default.yml
.gitlab-ci-main.yml

diff --git a/.gitlab-ci-coverage-runners.yml b/.gitlab-ci-coverage-runners.yml
new file mode 100644 (file)
index 0000000..0f6b2ec
--- /dev/null
@@ -0,0 +1,10 @@
+include:
+  - /.gitlab-ci-default-runners.yml
+
+.shared_runner_test:
+  # We need the more powerful n1-standard-2 runners
+  # in order to handle the lcov overhead.
+  #
+  # See .gitlab-ci-default-runners.yml for more details
+  tags:
+    - gitlab-org-docker
diff --git a/.gitlab-ci-coverage.yml b/.gitlab-ci-coverage.yml
new file mode 100644 (file)
index 0000000..8a9ded8
--- /dev/null
@@ -0,0 +1,12 @@
+# This is just used for the scheduled pipelines in the
+# https://gitlab.com/samba-team/samba configuration
+#
+
+variables:
+  SAMBA_CI_FLAVOR: "coverage"
+  # "--enable-coverage" or ""
+  SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE: "--enable-coverage"
+
+include:
+  - /.gitlab-ci-coverage-runners.yml
+  - /.gitlab-ci-main.yml
index ebfebbad9336c95ad8da47ab30c6f9dc4449b169..d0831017d9bbc83bb0fbd669f6f05c2ea2d7f0b9 100644 (file)
@@ -1,3 +1,9 @@
+variables:
+  SAMBA_CI_FLAVOR: "default"
+  # "--enable-coverage" or ""
+  # See .gitlab-ci-coverage.yml
+  SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE: ""
+
 include:
   - /.gitlab-ci-default-runners.yml
   - /.gitlab-ci-main.yml
index 425089ff467b26e82894b9cdfd4b82c6a22e8f4b..cbc812648e8239c81f3d874fb87ccf531701f1f7 100644 (file)
@@ -30,8 +30,6 @@ variables:
   #
   GIT_STRATEGY: fetch
   GIT_DEPTH: "3"
-  # "--enable-coverage" or ""
-  SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE: ""
   #
   # we run autobuild.py inside a samba CI docker image located on gitlab's registry
   # overwrite this variable if you want use your own image registry.
@@ -89,7 +87,7 @@ include:
     AUTOBUILD_JOB_NAME: $CI_JOB_NAME
   stage: build
   cache:
-    key: ccache.${CI_JOB_NAME}.${SAMBA_CI_JOB_IMAGE}
+    key: ccache.${CI_JOB_NAME}.${SAMBA_CI_JOB_IMAGE}.${SAMBA_CI_FLAVOR}
     paths:
       - ccache
   before_script:
@@ -191,6 +189,7 @@ others:
     # the acls again.
     - cp -a /sha1sum.txt /tmp/samba-testbase/image-sha1sum.txt
     - cp -a /tmp/commit.txt /tmp/samba-testbase/commit.txt
+    - ln -s /tmp/samba-testbase/${AUTOBUILD_JOB_NAME}/ /tmp/samba-testbase/build_subdir_link
     - pushd /tmp && getfacl -R samba-testbase > samba-testbase.acl.dump && popd
     - chmod -R +w /tmp/samba-testbase
     - mv /tmp/samba-testbase.acl.dump /tmp/samba-testbase/
@@ -213,6 +212,11 @@ others:
     - diff -u /tmp/samba-testbase/commit.txt /tmp/commit.txt
     - mv /tmp/samba-testbase/samba-testbase.acl.dump /tmp/samba-testbase.acl.dump
     - pushd /tmp && setfacl --restore=/tmp/samba-testbase.acl.dump && popd
+    - ls -la /tmp/samba-testbase/
+    - ls -la /tmp/samba-testbase/build_subdir_link
+    - ls -la /tmp/samba-testbase/build_subdir_link/
+    - if [ -n "$SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE" ]; then find /tmp/samba-testbase/build_subdir_link/ -type d -printf "'%p'\n" | xargs chmod u+w; fi
+    - ls -la /tmp/samba-testbase/build_subdir_link/
     # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
     # autobuild name, which means we can define a default template that runs most autobuild jobs
     - script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --skip-dependencies --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase
@@ -429,9 +433,12 @@ pages:
     - samba-no-opath1
     - samba-no-opath2
   script:
+    - ls -la *.info
     - ./configure.developer
     - make -j
+    - ls -la *.info
     - lcov $(ls *.info | xargs -I{} echo -n "-a {} ") -o all.info
+    - ls -la *.info
     - genhtml all.info --output-directory public --prefix=$(pwd) --title "coverage report for $CI_COMMIT_REF_NAME $CI_COMMIT_SHORT_SHA"
   artifacts:
     expire_in: 30 days