diff --git a/jobs/swh/core.yaml b/jobs/swh/core.yaml index 2091b1a..48a5e8e 100644 --- a/jobs/swh/core.yaml +++ b/jobs/swh/core.yaml @@ -1,8 +1,7 @@ - project: name: core + pkg: core jobs: - swh-{name} - swh-{name}/tests - - swh-{name}/metrics - swh-{name}/build - - swh-{name}/static diff --git a/jobs/swh/loader-mercurial.yaml b/jobs/swh/loader-mercurial.yaml index 7f9c801..37d668e 100644 --- a/jobs/swh/loader-mercurial.yaml +++ b/jobs/swh/loader-mercurial.yaml @@ -1,8 +1,6 @@ - project: name: loader-mercurial jobs: - swh-{name} - swh-{name}/tests - - swh-{name}/metrics - swh-{name}/build - - swh-{name}/static diff --git a/jobs/templates/swh-metrics.yaml b/jobs/templates/swh-metrics.yaml deleted file mode 100644 index 05b8c10..0000000 --- a/jobs/templates/swh-metrics.yaml +++ /dev/null @@ -1,47 +0,0 @@ -- job-template: - name: swh-{name}/metrics - node: swh-tox - - parameters: - - string: - name: BRANCH - default: '{branch|master}' - scm: - - git: - refspec: 'refs/heads/{branch|master}' - url: https://forge.softwareheritage.org/source/swh-{name}.git - - numToKeep: 20 - - triggers: - - pollscm: - cron: "H */3 * * *" - - wrappers: - - timestamps - - builders: - - shell: | - if [ ! -f tox.ini ] - then cat >tox.ini < reports/radon_raw.json - - shell: radon cc --json swh/ > reports/radon_cc.json - - shell: radon mi --json swh/ > reports/radon_mi.json - - publishers: - - archive: - artifacts: "reports/*" - allow-empty: "true" - fingerprint: "true" diff --git a/jobs/templates/swh-pipeline.yaml b/jobs/templates/swh-pipeline.yaml index b291397..0b5b30c 100644 --- a/jobs/templates/swh-pipeline.yaml +++ b/jobs/templates/swh-pipeline.yaml @@ -1,96 +1,84 @@ - job-template: - name: swh-{name}/static + name: swh-{name}/tests project-type: pipeline sandbox: true numToKeep: 20 dsl: | - def modname = '{name}'.replace('-', '.') pipeline {{ agent {{ label 'swh-tox' }} parameters {{ string(name: 'BRANCH', defaultValue: 'master', description: 'branch to checkout from the repository') }} stages {{ stage('Checkout') {{ steps {{ git branch: "${{params.BRANCH}}", url: 'https://forge.softwareheritage.org/source/swh-{name}.git' }} }} stage('Static analysis') {{ steps {{ echo "flake8" sh '''python3 -m flake8''' echo "radon" sh ''' mkdir -p reports python3 -m pip install --user --upgrade https://github.com/douardda/radon/archive/main-module.zip python3 -m radon raw --json swh/ > reports/raw_report.json python3 -m radon cc --json swh/ > reports/cc_report.json python3 -m radon mi --json swh/ > reports/mi_report.json python3 -m radon hal --json swh/ > reports/hal_report.json python3 -m radon cc --xml swh/ > reports/cc_report.xml ''' }} }} stage('Unit tests') {{ steps {{ sh ''' - if [ ! -f tox.ini ] - then cat >tox.ini <tox4jenkins.ini <tox.ini < - python3 -m tox -e py3 -- - --with-coverage --cover-xml - --cover-xml-file=./reports/covergage.xml - --cover-package=swh.{name} - --with-xunit --xunit-file=./reports/test-results.xml - - shell: python3 -m coverage xml -o ./reports/coverage.xml - - publishers: - - junit: - results: "reports/test-results.xml" - - cobertura: - report-file: "reports/coverage.xml" - fail-no-reports: "false" - fail-unhealthy: "false" - fail-unstable: "false" - only-stable: "false" - source-encoding: "UTF_8" - zoom-coverage-chart: "false" - targets: - - files: - healthy: 10 - unhealthy: 20 - failing: 30 - - method: - healthy: 50 - unhealthy: 40 - failing: 30