forked from blond-admin/BLonD
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
105 lines (92 loc) · 2.98 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
variables:
project_name: BLonD-1
# Set the project root to the directory containing your setup.py
project_root: ./
PYPI_UPLOAD_URL: "https://test.pypi.org/legacy/"
# # repo_style can be either "mono" or "solo"
# # A repo_style of "mono" will serve the docs by pulling them from a subproject folder
# repo_style: solo
# PIP_INDEX_URL: https://acc-py-repo.cern.ch/repository/vr-py-releases/simple/
# PIP_TRUSTED_HOST: acc-py-repo.cern.ch
# ACC_PY_GITLAB_CI_TEMPLATES_VERSION: "v0"
# __TRACE_TEMPLATES_COMMAND: "python -m pip install --upgrade -qq acc-py-tracing && python -m acc_py_tracing && ACC_PY_TRACING_DISABLED=1 python -m pip uninstall -y -qq acc-py-tracing"
.on_tag:
# Rules to run a job only on a git tagged commit
rules:
- if: $CI_COMMIT_TAG
when: on_success
.before:
before_script:
- apt-get update
- apt-get install -y gcc g++ build-essential mpich libmpich-dev
- python --version && gcc --version && mpirun --version
- pip install -v ${project_root}[test]
- python -m pip install pytest_cov mpi4py
.main:
script:
- cd ${project_root}
- python -m pytest -v unittests/ --cov --cov-config=.coveragerc --cov-report html
--cov-report xml --junitxml=junit-report.xml -k 'not test_validate'
- python -m pytest -v unittests/ --cov --cov-config=.coveragerc --cov-report html
--cov-report xml --junitxml=junit-report.xml -k 'test_validate'
.after:
after_script:
- cd ${project_root}
- coverage report
# - coverage xml -o coverage-report.xml
coverage: /(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
.publish:
artifacts:
expire_in: 30 days
reports:
# Enables https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html
coverage_report:
coverage_format: cobertura
path: ${project_root}/coverage-report.xml
# Enables https://docs.gitlab.com/ee/ci/unit_test_reports.html
junit: ${project_root}/junit-report.xml
paths:
- ${project_root}/coverage-html/*
# reports:
# junit: ${project_root}/coverage-report.xml
# test_py_37:
# variables:
# PY_VERSION: "3.7"
# image: python:${PY_VERSION}
# stage: test
# extends:
# - .before
# - .main
# - .after
# # - .publish
test_py_39:
variables:
PY_VERSION: "3.9"
image: python:${PY_VERSION}
stage: test
extends:
- .before
- .main
- .after
- .publish
release_sdist_39:
variables:
PY_VERSION: "3.9"
image: python:${PY_VERSION}
stage: deploy
extends:
- .on_tag
script:
- cd ${project_root}
- python -m pip install build twine
# Without an up-to-date setuptools, we don't get the requirements.txt
# inside the sdist.
- python -m pip install -U setuptools
- eval ${PRE_SDIST_BUILD}
- python -m build --sdist .
- git status
- python -m twine upload --verbose
--repository-url="${PYPI_UPLOAD_URL}"
--username="${PYPI_USERNAME}"
--password="${PYPI_PASSWORD}"
dist/*.tar.gz