-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
93 lines (76 loc) · 1.97 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
default:
image: python:3.8-slim
workflow:
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH == 'main'
stages:
- Static Analysis
- Install
- Documentation
- Test
- Ship
# -------------------------- Static analysis -----------------------------------
.static_analysis_base:
stage: Static Analysis
allow_failure: true
flake8:
extends: .static_analysis_base
script:
- pip install flake8
- flake8 $PWD/theia_picker
pylint:
extends: .static_analysis_base
script:
- pip install pylint requests pydantic urllib3 tqdm
- pylint $PWD/theia_picker
codespell:
extends: .static_analysis_base
script:
- pip install codespell
- codespell $PWD/theia_picker
# ----------------------------- Install ----------------------------------------
pip_install:
stage: Install
script:
- pip install .
- python -c "import theia_picker"
# ------------------------------- Doc ------------------------------------------
.doc_base:
stage: Documentation
before_script:
- pip install mkdocstrings mkdocstrings[crystal,python] mkdocs-material mkdocs-gen-files mkdocs-section-index mkdocs-literate-nav mkdocs-mermaid2-plugin --upgrade
artifacts:
paths:
- public
- public_test
pages_tests:
extends: .doc_base
except:
- main
script:
- mkdocs build --site-dir public_test
pages:
extends: .doc_base
only:
- main
script:
- mkdocs build --site-dir public
# -------------------------------- Tests ---------------------------------------
tests:
stage: Test
allow_failure: false
script:
- pip install .
- python test/download_test.py
# --------------------------------- Ship ---------------------------------------
pypi:
stage: Ship
only:
- main
before_script:
- python3 -m pip install --upgrade build twine
script:
- python3 -m build
after_script:
- python3 -m twine upload --repository-url https://upload.pypi.org/legacy/ --non-interactive -u __token__ -p $pypi_token dist/*