-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
57 lines (50 loc) · 1.03 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
image: python:latest
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
default:
cache: &global_cache
key: $CI_COMMIT_REF_SLUG
policy: pull-push
paths:
- .cache/pip
- venv/
before_script:
- python -V
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install -r requirements-dev.txt
- pip install -e .
stages:
- build
- test
- publish
build:
stage: build
script:
- python -m build
artifacts:
paths:
- dist/*.whl
test:
cache:
<<: *global_cache
policy: pull
stage: test
needs: []
script:
- pytest --cov=iqtrade
- mypy iqtrade examples tests
- flake8 iqtrade examples tests
- black --diff --check iqtrade tests examples
publish:
cache:
<<: *global_cache
policy: pull
stage: publish
only:
- tags
needs: ["build"]
script:
- python -m twine upload dist/*
when: manual