diff --git a/Jenkinsfile b/Jenkinsfile index 1f6245051..d13a0e7ef 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,6 +22,7 @@ pipeline { pip3 install -e . ''' } + } } } @@ -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') { @@ -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 @@ -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} ''' } } diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..9f9d97b6f --- /dev/null +++ b/codecov.yml @@ -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" \ No newline at end of file