Skip to content

Commit 21ee7e4

Browse files
authored
Merge pull request #888 from AlexVCaron/fix/jenkins_codecov
[WIP] Fix bad commit in codecov
2 parents 29c7968 + 13b8128 commit 21ee7e4

File tree

2 files changed

+47
-6
lines changed

2 files changed

+47
-6
lines changed

Jenkinsfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pipeline {
2222
pip3 install -e .
2323
'''
2424
}
25+
2526
}
2627
}
2728
}
@@ -30,6 +31,14 @@ pipeline {
3031
stage('Test') {
3132
environment {
3233
CODECOV_TOKEN = credentials('scilpy-codecov-token')
34+
CODECOV_GIT_COMMIT = """${sh(
35+
returnStdout: true,
36+
script: 'git rev-parse $GIT_BRANCH'
37+
).trim()}"""
38+
CODECOV_PARENT_COMMIT = """${sh(
39+
returnStdout: true,
40+
script: 'git merge-base origin/master $GIT_BRANCH'
41+
).trim()}"""
3342
}
3443
steps {
3544
withPythonEnv('CPython-3.10') {
@@ -45,11 +54,6 @@ pipeline {
4554
'''
4655
}
4756
discoverGitReferenceBuild()
48-
recordCoverage(
49-
name: 'Scilpy Coverage Report',
50-
sourceCodeRetention: 'MODIFIED',
51-
tools: [[parser: 'COBERTURA',
52-
pattern: '**/.test_reports/coverage.xml']])
5357
sh '''
5458
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --import # One-time step
5559
curl -Os https://uploader.codecov.io/latest/linux/codecov
@@ -60,7 +64,10 @@ pipeline {
6064
shasum -a 256 -c codecov.SHA256SUM
6165
6266
chmod +x codecov
63-
./codecov -t ${CODECOV_TOKEN} -f .test_reports/coverage.xml
67+
./codecov -v -t ${CODECOV_TOKEN} \
68+
-f .test_reports/coverage.xml \
69+
-C ${CODECOV_GIT_COMMIT} \
70+
-N ${CODECOV_PARENT_COMMIT}
6471
'''
6572
}
6673
}

codecov.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
codecov:
2+
allow_coverage_offsets: True
3+
4+
coverage:
5+
status:
6+
project:
7+
default:
8+
target: 75%
9+
threshold: 2%
10+
branches:
11+
- master
12+
if_ci_failed: error
13+
only_pulls: false
14+
patch:
15+
default:
16+
target: 90%
17+
branches:
18+
- master
19+
if_ci_failed: error
20+
only_pulls: false
21+
22+
component_management:
23+
individual_components:
24+
- component_id: scilpy_scripts
25+
name: Scripts
26+
paths:
27+
- scripts/
28+
- component_id: scilpy_library
29+
name: Library
30+
paths:
31+
- scilpy/
32+
33+
comment:
34+
layout: "condensed_header, diff, components"

0 commit comments

Comments
 (0)