-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
61 lines (53 loc) · 1.49 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
# This file is based on the following template:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
# Python image found here:
# https://hub.docker.com/r/library/python/tags/
image: python:3.7.4
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/topics/caching/
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
paths:
- .cache/pip
- venv/
before_script:
- python --version # For debugging
- python -m venv venv
- source venv/bin/activate
- pip install --upgrade pip
- pip install wheel
- apt-get update --yes
- apt-get install --yes cmake
- pip install python-libsbml==5.19
- pip install -e .
test:
stage: test
script:
- pip install pytest pytest-cov
- coverage run -m pytest
- coverage report
- coverage xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
build_and_publish:
stage: deploy
script:
- pip install poetry
- poetry build
- poetry config pypi-token.pypi $PYPI_TOKEN
- poetry publish
artifacts:
paths:
- dist/*
rules:
- if: $CI_COMMIT_TAG # only deploy if commit is tagged