-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
81 lines (73 loc) · 1.79 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
stages:
- checks
- build
- publish
black:
stage: checks
image: registry.gitlab.com/pipeline-components/black:latest
script:
- echo "version"
- echo black --version
- black --check --verbose -- .
tags:
- docker
tests:
stage: checks
image: "registry.forgemia.inra.fr/bbatardiere/docker-image-pandas-torch-sphinx-jupyter"
before_script:
pip install '.[tests]'
script:
- pip install .
- jupyter nbconvert Getting_started.ipynb --to python --output tests/test_getting_started
- cd tests
- python create_readme_getting_started_and_docstrings_tests.py
- rm test_getting_started.py # remove as it has been modified in a directory.
- pytest .
only:
- main
- dev
- tags
build_package:
stage: build
image: "registry.forgemia.inra.fr/bbatardiere/docker-image-pandas-torch-sphinx-jupyter"
before_script:
- pip install build
script:
- rm -rf dist/
- python -m build
artifacts:
untracked: true
expire_in: 1 week
tags:
- docker
publish_package:
stage: publish
image: "python:3.9"
before_script:
- pip install twine
script:
- TWINE_PASSWORD=${pypln_token} TWINE_USERNAME=__token__ python -m twine upload dist/*
tags:
- docker
only:
- tags
pages:
stage: publish
image: "registry.forgemia.inra.fr/bbatardiere/docker-image-pandas-torch-sphinx-jupyter"
before_script:
- pip install '.[build-doc]'
script:
- wget https://github.com/jgm/pandoc/releases/download/1.15.1/pandoc-1.15.1-1-amd64.deb
- dpkg -i pandoc-1.15.1-1-amd64.deb
- pandoc README.md --from markdown --to rst -s -o docs/source/readme.rst
- pip install .
- make -C docs html
- rm -rf public/
- cp -r docs/build/html public
artifacts:
paths:
- public
tags:
- docker
only:
- tags