-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
77 lines (75 loc) · 2.74 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
test:
image: continuumio/miniconda3:4.6.14
before_script:
- conda config --add channels conda-forge
- conda env create -f environment_ci.yml
- source activate tagmaps
# install (fixed) argdown from local repo
- pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.vgiscience.de/ad/argdown.git
stage: test
script:
# test dev install
- pip install -e . --no-dependencies
# run main integration test
- cleaned_data_file=resources/01_Input/flickr_dresden_cc-by-licenses.csv
- python tests/test_all.py --max_items 50 --auto_mode --load_intermediate=$cleaned_data_file
# argparse to markdown conversion
# for mkdocs args page
- python docs/argparse/argparse_doc.py
- argdown parse_args.py > docs/argparse/args.md
# install pdoc3 for additional api ref
- pip install pdoc3
# enable all warnings during ci doc generation
# - export PYTHONWARNINGS='error::UserWarning'
- pdoc --template-dir docs/apidoc/ --html --output-dir docs/api/ tagmaps
# create badges
- pylint --output-format=text tagmaps | tee pylint.txt || pylint-exit $?
- score=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.txt)
- echo "Pylint score was $score"
- anybadge -l pylint --value=$score --file=pylint.svg 2=red 4=orange 9=yellow 10=green
- anybadge -l pipeline --value=passing --file=pipeline.svg passing=green failing=red
- pypi_version=$(pip search tagmaps | cut -d "(" -f2 | cut -d ")" -f1 | sed -r "s/[latest]+//g")
- echo "Pypi version was $pypi_version"
- conda_version=$(conda search tagmaps -c conda-forge | tail -1 | awk '{print $2}')
- echo "Conda version was $conda_version"
- anybadge -l pypi --value="$pypi_version" --file=pypi.svg --color=green
- anybadge -l conda-forge --value="$conda_version" --file=conda-forge.svg --color=orange
- anybadge -l mkdocs --value="Documentation" --file=documentation.svg --color=green
artifacts:
paths:
- pylint.svg
- pypi.svg
- pipeline.svg
- conda-forge.svg
- documentation.svg
- docs/argparse/args.md
- docs/api/
only:
- master
- ci-test
pages:
stage: deploy
image: python:alpine
before_script:
- pip install mkdocs
# Add your custom theme if not inside a theme_dir
# (https://github.com/mkdocs/mkdocs/wiki/MkDocs-Themes)
script:
- mkdir .public
- cp resources/img6.png .public
- cp resources/tagmaps_steps.png .public
- cp *.svg .public
- mv .public public
# build docs
- mkdocs build
- mv site public
# copy pdoc3 compiled API ref
- mv docs/api/tagmaps/* public/site/api/
- mv public/site public/docs
artifacts:
name: pages
paths:
- public
only:
- master
- ci-test