From 442b7b4e34e1e6844211c9c868b927d60e61797b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 6 Oct 2020 16:43:52 +1000 Subject: [PATCH] gitlab CI: add git depth to the coverity job and save the artifacts 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 --- .gitlab-ci.yml | 8 ++++++++ .gitlab-ci/ci.template | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 780ac17e..bf7b9a62 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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" diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index 74c8bce0..76c7e11c 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -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" -- GitLab