Skip to content

Commit 0cf5b6b

Browse files
committed
ci: ignore coverity failures in nightly runs
Coverity is back but it's only read-only! Agh. Just allow it to fail and not impact the overall job run.
1 parent e9a3486 commit 0cf5b6b

File tree

4 files changed

+69
-43
lines changed

4 files changed

+69
-43
lines changed

azure-pipelines/coverity.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
resources:
2+
- repo: self
3+
4+
jobs:
5+
- job: coverity
6+
displayName: 'Coverity'
7+
pool:
8+
vmImage: 'Ubuntu 16.04'
9+
steps:
10+
- task: Docker@0
11+
displayName: Build
12+
inputs:
13+
action: 'Run an image'
14+
imageName: 'libgit2/trusty-openssl:latest'
15+
volumes: |
16+
$(Build.SourcesDirectory):/src
17+
$(Build.BinariesDirectory):/build
18+
envVars: |
19+
COVERITY_TOKEN=$(COVERITY_TOKEN)
20+
workDir: '/build'
21+
containerCommand: '/src/ci/coverity-build.sh'
22+
detached: false
23+
- task: Docker@0
24+
displayName: Publish
25+
inputs:
26+
action: 'Run an image'
27+
imageName: 'libgit2/trusty-openssl:latest'
28+
volumes: |
29+
$(Build.SourcesDirectory):/src
30+
$(Build.BinariesDirectory):/build
31+
envVars: |
32+
COVERITY_TOKEN=$(COVERITY_TOKEN)
33+
workDir: '/build'
34+
containerCommand: '/src/ci/coverity-publish.sh'
35+
detached: false
36+
continueOnError: true

azure-pipelines/nightly.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -186,22 +186,3 @@ jobs:
186186
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL
187187
RUN_INVASIVE_TESTS=true
188188
SKIP_PROXY_TESTS=true
189-
190-
- job: coverity
191-
displayName: 'Coverity'
192-
pool:
193-
vmImage: 'Ubuntu 16.04'
194-
steps:
195-
- task: Docker@0
196-
displayName: Build
197-
inputs:
198-
action: 'Run an image'
199-
imageName: 'libgit2/trusty-openssl:latest'
200-
volumes: |
201-
$(Build.SourcesDirectory):/src
202-
$(Build.BinariesDirectory):/build
203-
envVars: |
204-
COVERITY_TOKEN=$(COVERITY_TOKEN)
205-
workDir: '/build'
206-
containerCommand: '/src/ci/coverity.sh'
207-
detached: false

ci/coverity.sh renamed to ci/coverity-build.sh

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,3 @@ COVERITY_UNSUPPORTED=1 \
3939
$COV_BUILD --dir cov-int \
4040
cmake --build .
4141

42-
# Upload results
43-
tar czf libgit2.tgz cov-int
44-
SHA=$(cd ${SOURCE_DIR} && git rev-parse --short HEAD)
45-
46-
HTML="$(curl \
47-
--silent \
48-
--write-out "\n%{http_code}" \
49-
--form token="$COVERITY_TOKEN" \
50-
--form email=libgit2@gmail.com \
51-
--form file=@libgit2.tgz \
52-
--form version="$SHA" \
53-
--form description="libgit2 build" \
54-
https://scan.coverity.com/builds?project=libgit2)"
55-
# Body is everything up to the last line
56-
BODY="$(echo "$HTML" | head -n-1)"
57-
# Status code is the last line
58-
STATUS_CODE="$(echo "$HTML" | tail -n1)"
59-
60-
echo "${BODY}"
61-
62-
if [ "${STATUS_CODE}" != "200" -a "${STATUS_CODE}" != "201" ]; then
63-
echo "Received error code ${STATUS_CODE} from Coverity"
64-
exit 1
65-
fi

ci/coverity-publish.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Results check
6+
[ ! -d "cov-int" ] && echo "Coverity directory not found" && exit 1
7+
8+
# Upload results
9+
tar czf libgit2.tgz cov-int
10+
11+
SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )}
12+
SHA=$(cd ${SOURCE_DIR} && git rev-parse --short HEAD)
13+
14+
HTML="$(curl \
15+
--silent \
16+
--write-out "\n%{http_code}" \
17+
--form token="$COVERITY_TOKEN" \
18+
--form email=libgit2@gmail.com \
19+
--form file=@libgit2.tgz \
20+
--form version="$SHA" \
21+
--form description="libgit2 build" \
22+
https://scan.coverity.com/builds?project=libgit2)"
23+
24+
# Body is everything up to the last line
25+
BODY="$(echo "$HTML" | head -n-1)"
26+
27+
# Status code is the last line
28+
STATUS_CODE="$(echo "$HTML" | tail -n1)"
29+
30+
if [ "${STATUS_CODE}" != "200" -a "${STATUS_CODE}" != "201" ]; then
31+
echo "Received error code ${STATUS_CODE} from Coverity"
32+
exit 1
33+
fi

0 commit comments

Comments
 (0)