Skip to content

Commit

Permalink
Merge pull request #888 from AlexVCaron/fix/jenkins_codecov
Browse files Browse the repository at this point in the history
[WIP] Fix bad commit in codecov
  • Loading branch information
arnaudbore committed Jan 29, 2024
2 parents 29c7968 + 13b8128 commit 21ee7e4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pipeline {
pip3 install -e .
'''
}

}
}
}
Expand All @@ -30,6 +31,14 @@ pipeline {
stage('Test') {
environment {
CODECOV_TOKEN = credentials('scilpy-codecov-token')
CODECOV_GIT_COMMIT = """${sh(
returnStdout: true,
script: 'git rev-parse $GIT_BRANCH'
).trim()}"""
CODECOV_PARENT_COMMIT = """${sh(
returnStdout: true,
script: 'git merge-base origin/master $GIT_BRANCH'
).trim()}"""
}
steps {
withPythonEnv('CPython-3.10') {
Expand All @@ -45,11 +54,6 @@ pipeline {
'''
}
discoverGitReferenceBuild()
recordCoverage(
name: 'Scilpy Coverage Report',
sourceCodeRetention: 'MODIFIED',
tools: [[parser: 'COBERTURA',
pattern: '**/.test_reports/coverage.xml']])
sh '''
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --import # One-time step
curl -Os https://uploader.codecov.io/latest/linux/codecov
Expand All @@ -60,7 +64,10 @@ pipeline {
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
./codecov -t ${CODECOV_TOKEN} -f .test_reports/coverage.xml
./codecov -v -t ${CODECOV_TOKEN} \
-f .test_reports/coverage.xml \
-C ${CODECOV_GIT_COMMIT} \
-N ${CODECOV_PARENT_COMMIT}
'''
}
}
Expand Down
34 changes: 34 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
codecov:
allow_coverage_offsets: True

coverage:
status:
project:
default:
target: 75%
threshold: 2%
branches:
- master
if_ci_failed: error
only_pulls: false
patch:
default:
target: 90%
branches:
- master
if_ci_failed: error
only_pulls: false

component_management:
individual_components:
- component_id: scilpy_scripts
name: Scripts
paths:
- scripts/
- component_id: scilpy_library
name: Library
paths:
- scilpy/

comment:
layout: "condensed_header, diff, components"

0 comments on commit 21ee7e4

Please sign in to comment.