-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitlab-ci.yml
85 lines (75 loc) · 1.67 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
image: "registry.gitlab.com/mia_jinns/docker-image-quarto-jax-sphinx:main"
stages:
- linting
- tests
- build
- publish
black:
stage: linting
image: registry.gitlab.com/pipeline-components/black:latest
script:
- black --check --verbose -- .
tags:
- saas-linux-small-amd64
run_tests:
stage: tests
before_script:
- pip install --break-system-packages pytest coverage pytest-cov
- pwd
script:
- pip install --break-system-packages -e .
- pytest --cov=jinns --ignore=tests/solver_tests/test_NSPipeFlow_x64.py
coverage: '/TOTAL.*\s+(\d+%)$/'
build_doc:
stage: build
needs: [] # don't need to wait for other jobs
before_script:
script:
- pip install --break-system-packages -e .
- pip install --break-system-packages -r docs/doc_requirements.txt
- mkdocs build
- mkdocs build # twice, see https://github.com/patrick-kidger/pytkdocs_tweaks
artifacts:
untracked: true
expire_in: 1 week
tags:
- saas-linux-small-amd64
build_package:
stage: build
image: "python:3.9"
before_script:
- pip install build
script:
- rm -rf dist/
- python -m build
artifacts:
untracked: true
expire_in: 1 week
tags:
- saas-linux-small-amd64
publish_package:
stage: publish
image: "python:3.9"
before_script:
- pip install twine
script:
- TWINE_PASSWORD=${PYPI_UPLOAD_TOKEN}
TWINE_USERNAME=__token__
python -m twine upload dist/*
tags:
- saas-linux-small-amd64
only:
- tags
pages:
stage: publish
image: "python:3.9"
script:
- rm -rf public/
- cp -r site/ public/
artifacts:
paths:
- public
tags:
- saas-linux-small-amd64
only:
- main