-
Notifications
You must be signed in to change notification settings - Fork 12
/
.gitlab-ci.yml
87 lines (80 loc) · 2.5 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
image: deavidsedice/pineboo-build:latest-devel
variables:
GIT_STRATEGY: fetch
GIT_CLEAN_FLAGS: none
GIT_SUBMODULE_STRATEGY: none
# 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/reference/pip_install/#caching
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
stages:
- test
- deploy
before_script:
- python3 -V | ts # Print out python version for debugging
- pip3 install -r requirements.txt | ts
# - pip install virtualenv
# - virtualenv venv
# - source venv/bin/activate
# Spawn 2 runners for testing:
test_flake8_pydocstyle:
stage: test
script:
- flake8 pineboolib/
# PyDocStyle lacks "exclude":
- rm pineboolib/application/parsers/qsaparser/lextab.py || /bin/true
- pydocstyle pineboolib/application pineboolib/core pineboolib/interfaces
test_mypy_pyroma_black_pytest:
cache:
key: "mypy-1-$CI_COMMIT_REF_SLUG"
paths:
- .mypy_cache/
stage: test
script:
- mypy -p pineboolib
- pyroma .
- black --check --fast -l 100 --exclude='(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist|lextab.py)' pineboolib/
- pytest --cov=pineboolib pineboolib/
- coverage report --fail-under=23
- ./test_import_safety.sh
deploy_build:
stage: deploy
script:
- python3 setup.py bdist_wheel
# an alternative approach is to install and run:
- pip3 install dist/*
# run the command here
# pineboo --help
artifacts:
paths:
- dist/*.whl
pages:
cache:
key: "pages-1-$CI_COMMIT_REF_SLUG"
paths:
- .mypy_cache/
- docs/source/_static/linters/
- docs/source/linters/pylint/static
- docs/index_template.rst
- docs/source/code/pineboolib
- docs/build/
stage: deploy
script:
# NOTE: to be able to use cache for sphinx:
# Reset modification time of the files to the original authored time.
- ./git_reset_mtime.sh
- cd docs
- ./create_docs.sh | ts
- ./update_linters.sh | ts
- make html | ts
- cp -R build/html/ ../public/
artifacts:
paths:
- public
# only:
# - master