gitlab CI: add git depth to the coverity job and save the artifacts
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 6 Oct 2020 06:43:52 +0000 (16:43 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 6 Oct 2020 21:27:13 +0000 (07:27 +1000)
A default git depth of 1 means git describe won't work, let's set it to
something high enough that we should always have at least one tag in the
history.

And save the artifacts after the coverity compilation, where the submission
fails for whatever reason we can just resubmit those manually without having
to rebuild the whole image locally.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
.gitlab-ci.yml
.gitlab-ci/ci.template

index 780ac17e1a2c203db5200720e5b7bd007c2566bc..bf7b9a624fd248fbc84a107759770ae15b507864 100644 (file)
@@ -760,6 +760,8 @@ coverity:
     # coverity doesn't work on Fedora 32
     FDO_DISTRIBUTION_VERSION: '31'
     FDO_DISTRIBUTION_TAG: $FEDORA_TAG
+    # so git-describe works, or should work
+    GIT_DEPTH: 200
   only:
     variables:
       - $COVERITY_SCAN_TOKEN
@@ -777,6 +779,12 @@ coverity:
         --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
         --form file=@cov-int.tar.gz --form version="$(git describe --tags)"
         --form description="$(git describe --tags) / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
+  artifacts:
+    name: "coverity-submit-data"
+    when: always
+    expire_in: 1 week
+    paths:
+      - cov-int.tar.gz
   needs:
     - "fedora:31@container-prep"
 
index 74c8bce0e7efc1949e93d57e48d283cc91f56fa9..76c7e11c52e8c38cd531bda5a3bfe8ab06163c25 100644 (file)
@@ -603,6 +603,8 @@ coverity:
     # coverity doesn't work on Fedora 32
     FDO_DISTRIBUTION_VERSION: '31'
     FDO_DISTRIBUTION_TAG: $FEDORA_TAG
+    # so git-describe works, or should work
+    GIT_DEPTH: 200
   only:
     variables:
       - $COVERITY_SCAN_TOKEN
@@ -620,6 +622,12 @@ coverity:
         --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
         --form file=@cov-int.tar.gz --form version="$(git describe --tags)"
         --form description="$(git describe --tags) / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
+  artifacts:
+    name: "coverity-submit-data"
+    when: always
+    expire_in: 1 week
+    paths:
+      - cov-int.tar.gz
   needs:
     - "fedora:31@container-prep"