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 <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-10-06 16:43:52 +10:00
parent 82bf473d99
commit 442b7b4e34
2 changed files with 16 additions and 0 deletions

View 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"

View 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"