Commit 5ea62f8b authored by Noé Gaumont's avatar Noé Gaumont 🐙
Browse files

ci: backport gitlab-ci

--HG--
branch : 3.27
parent af4120454c0f
image: python:latest
stages:
- lint
- tests
- after-tests
- qa
- deploy
lint_py:
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
only:
changes:
- "**/*.py"
stage: lint
before_script:
- pip install tox
script:
- tox -e flake8
lint_manifest:
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
stage: lint
before_script:
- pip install tox
script:
- tox -e check-manifest
lint_doc8:
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
only:
changes:
- doc/**/*
stage: lint
before_script:
- pip install tox
script:
- tox -e doc8
build_doc:
only:
changes:
- doc/**/*
- "**/*.py"
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
stage: lint
before_script:
- pip install tox
script:
- tox -e doc
artifacts:
paths:
- .tox/doc/tmp/html
allow_failure: true # XXX fix me
py3_server:
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
stage: tests
image: r.intra.logilab.fr/jenkins/jnlp:buster
before_script:
- sudo apt update
- sudo DEBIAN_FRONTEND=noninteractive APT_LISTCHANGES_FRONTEND=none apt-get install -y --assume-yes -qq -o=Dpkg::Use-Pty=0 slapd ldap-utils
script:
- tox -e py3-server
artifacts:
paths:
- /builds/cubicweb/cubicweb/server.html
- /builds/cubicweb/cubicweb/py3-server-deprecated-warnings.json
- /reports/coverage-server.xml
only:
changes:
- cubicweb/**/*
py3_web:
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
only:
changes:
- cubicweb/**/*
stage: tests
image: r.intra.logilab.fr/jenkins/jnlp:buster
before_script:
- sudo apt update && sudo apt install -y firefox-esr
script:
- tox -e py3-web
artifacts:
paths:
- /builds/cubicweb/cubicweb/web.html
- /builds/cubicweb/cubicweb/py3-web-deprecated-warnings.json
- /reports/coverage-web.xml
py3_misc:
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
only:
changes:
- cubicweb/**/*
stage: tests
image: r.intra.logilab.fr/jenkins/jnlp:buster
before_script:
- sudo apt update && sudo apt install -y firefox-esr
script:
- tox -e py3-misc
artifacts:
paths:
- /builds/cubicweb/cubicweb/misc.html
- /builds/cubicweb/cubicweb/py3-misc-deprecated-warnings.json
- /reports/coverage-misc.xml
py3-from-forge-server:
only:
changes:
- cubicweb/**/*
stage: tests
image: r.intra.logilab.fr/jenkins/jnlp:buster
allow_failure: true
before_script:
- sudo apt update
- sudo DEBIAN_FRONTEND=noninteractive APT_LISTCHANGES_FRONTEND=none apt-get install -y --assume-yes -qq -o=Dpkg::Use-Pty=0 slapd ldap-utils
artifacts:
paths:
- /builds/cubicweb/cubicweb/from-forge-server.html
- /builds/cubicweb/cubicweb/py3-from-forge-server-deprecated-warnings.json
script:
- tox -e py3-from-forge-server
py3-from-forge-web:
only:
changes:
- cubicweb/**/*
stage: tests
image: r.intra.logilab.fr/jenkins/jnlp:buster
allow_failure: true
before_script:
- sudo apt update && sudo apt install -y firefox-esr
script:
- tox -e py3-from-forge-web
artifacts:
paths:
- /builds/cubicweb/cubicweb/from-forge-web.html
- /builds/cubicweb/cubicweb/py3-from-forge-web-deprecated-warnings.json
py3-from-forge-misc:
only:
changes:
- cubicweb/**/*
stage: tests
image: r.intra.logilab.fr/jenkins/jnlp:buster
allow_failure: true
before_script:
- sudo apt update && sudo apt install -y firefox-esr
script:
- tox -e py3-from-forge-misc
artifacts:
paths:
- /builds/cubicweb/cubicweb/from-forge-misc.html
- /builds/cubicweb/cubicweb/py3-from-forge-misc-deprecated-warnings.json
trigger-readthedocs:
only:
refs:
- branch/default
changes:
- cubicweb/**/*
- doc/**/*
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
stage: after-tests
script:
# regarding the " everywhere when there is a '%': yaml is extremly weird when % are involved
- curl -X POST -d "token=${READTHEDOCS_TOKEN}" https://readthedocs.org/api/v2/webhook/cubicweb/33537/ -w "\nhttp code:"\ "%{http_code}\n" -f
sonarqube:
stage: qa
image: sonarsource/sonar-scanner-cli
only:
- branch/default
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
script:
- apk add python3 mercurial
- sonar-scanner
--define sonar.scm.revision=${CI_COMMIT_REF_NAME##*/}
--define sonar.projectBaseDir=.
--define sonar.projectVersion=`python3 ./setup.py --version`
--define sonar.scm.provider=hg
--define sonar.projectKey=${CI_PROJECT_PATH_SLUG}
--define sonar.projectName=${CI_PROJECT_TITLE}
--define sonar.links.homepage=${CI_PROJECT_URL}
--define sonar.host.url=${SONAR_URL}
pages:
stage: deploy
except:
variables:
- $TRIGGERED_FROM_OTHER_PROJECT
before_script:
- pip install tox
script:
# remove previous artifacts from build_doc if any (cf. #206). The .tox/doc
# directory does not « look as a virtualenv », and tox refuses to remove it.
# Let's do it manually.
- rm -rf .tox/doc/
- tox -e doc
- mv .tox/doc/tmp/html public
artifacts:
paths:
- public
only:
- branch/default
......@@ -83,4 +83,5 @@ recursive-include cubicweb/skeleton *.py *.css *.js *.po compat *.tmpl format op
prune cubicweb/misc/cwfs
prune debian
prune cubicweb.spec
exclude cubicweb.spec
exclude .gitlab-ci.yml
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment