-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
70 lines (69 loc) · 2.42 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
test:
image: registry.gitlab.vgiscience.org/tud_ifk/miniconda-cidefault
before_script:
# initialize conda shell
- conda init bash
- source ~/.bashrc
# activate default ci_env from registry image
# contains anybadge
- conda activate ci_env
- conda env create -f environment_dev.yml
# activate tagmaps env
# with --stack environments
- conda activate lbsntransform --stack
# install additional packages
# needed in lbsntransform ci job
- pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.vgiscience.de/tud_ifk/argdown.git
- conda install pylint bitarray
- pip install pdoc3 pylint-exit
stage: test
script:
# test dev install
- pip install -e . --no-dependencies
# argparse to markdown conversion
# for mkdocs args page
- python docs/argparse/argparse_doc.py
- argdown --truncate-help parse_args.py > docs/argparse/args.md
# to enable all warnings during ci doc generation
# - export PYTHONWARNINGS='error::UserWarning'
- pdoc --config show_type_annotations=True --template-dir docs/apidoc/ --html --output-dir docs/api/ lbsntransform
# create badges
- pylint --output-format=text lbsntransform | 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 lbsntransform | cut -d "(" -f2 | cut -d ")" -f1 | sed -r "s/[latest]+//g")
- echo "Pypi version was $pypi_version"
- anybadge -l pypi --value="$pypi_version" --file=pypi.svg --color=green
- anybadge -l mkdocs --value="Documentation" --file=documentation.svg --color=green
artifacts:
paths:
# quote because * is a
# special character in YAML
- '*.svg'
- docs/argparse/args.md
- docs/api/
only:
- master
- ci-test
pages:
stage: deploy
image: registry.gitlab.vgiscience.org/tud_ifk/alpine-mkdocs
script:
- mkdir .public
- cp *.svg .public
- mv .public public
# build docs
- mkdocs build
- mv site public
# copy pdoc3 compiled API ref
- mv docs/api/lbsntransform/* public/site/api/
- mv public/site public/docs
artifacts:
name: pages
paths:
- public
only:
- master
- ci-test