forked from TimeEval/GutenTAG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
65 lines (59 loc) · 1.7 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
# akita conda runner uses the following image by default:
# image: continuumio/miniconda3:4.9.2
stages:
- test
- build
- deploy
workflow:
rules:
# If `$FORCE_GITLAB_CI` is set, create a pipeline.
- if: '$FORCE_GITLAB_CI'
# For merge requests, create a pipeline.
- if: '$CI_MERGE_REQUEST_IID'
# For `main` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
# For tags, create a pipeline.
- if: '$CI_COMMIT_TAG'
# For branches starting with 'doc/' don't create a pipeline
- if: '$CI_COMMIT_BRANCH =~ /^doc\//'
when: never
default:
tags:
- akita
- conda
before_script:
- export PIP_CACHE_DIR="/opt/cache/pip"
- echo "Setting up conda environment and installing dependencies"
- conda create -y -n gutentag python=${PYTHON_VERSION:-3.7}
- source activate gutentag
- pip install -r requirements.dev
- python --version
test:
stage: test
interruptible: true
script:
- python setup.py typecheck
- python setup.py test
artifacts:
reports:
cobertura: coverage.xml
parallel:
matrix:
- PYTHON_VERSION: ["3.7", "3.8", "3.9", "3.10"]
build:
stage: build
only:
- tags
script:
- python setup.py sdist bdist_wheel
artifacts:
paths:
- dist/*.tar.gz
- dist/*.whl
deploy:
stage: deploy
only:
- tags
script:
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url https://gitlab.hpi.de/api/v4/projects/${CI_PROJECT_ID}/packages/pypi dist/*
- TWINE_PASSWORD="${PYPI_API_TOKEN}" TWINE_USERNAME="__token__" python -m twine upload --repository pypi dist/*