-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
99 lines (84 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# This script is an edited version of the example found at
# https://git.ligo.org/lscsoft/example-ci-project/blob/python/.gitlab-ci.yml
# Each 0th-indendation level is a job that will be run within GitLab CI
# The only exception are a short list of reserved keywords
#
# https://docs.gitlab.com/ee/ci/yaml/#gitlab-ci-yml
# stages is a reserved keyword that defines job dependencies and
# parallelization. each stage runs in parallel but must complete
# before the next stage begins
# This file was copied from bilby_pipe
stages:
- initial
- documentation
- deploy
.basic-python: &basic-python
stage: initial
image: python
before_script:
- pip install --upgrade pip
script:
- pip install --ignore-installed .
- cd ..
- python -c "import popstock"
- python -c "import popstock.PopulationOmegaGW"
- python -c "import popstock.constants"
- python -c "import popstock.util"
- for script in $(pip show -f popstock | grep "bin\/" | xargs -I {} basename {}); do
${script} --help;
done
basic-3.8:
<<: *basic-python
image: python:3.8
basic-3.9:
<<: *basic-python
image: python:3.9
basic-3.10:
<<: *basic-python
image: python:3.10
.precommits-python: &precommits-python
stage: initial
image: python
script:
- pip install --upgrade pip
- pip install .
- pip install pre-commit
# Run precommits (black, flake8, spellcheck, isort, no merge conflicts, etc)
- pre-commit run --files popstock/*.py --verbose --show-diff-on-failure
#- pre-commit run --files test/*.py --verbose --show-diff-on-failure
#- pre-commit run --files tutorials/*.py --verbose --show-diff-on-failure
- pre-commit run --files *.py --verbose --show-diff-on-failure
precommits-py3.8:
<<: *precommits-python
image: python:3.8
documentation:
stage: documentation
image: python:3.8
before_script:
- apt-get -yqq update
- apt-get -yqq install pandoc
- pip install --upgrade pip setuptools
- pip install ipykernel ipython==8.12.0 jupyter
- pip install sphinx numpydoc nbsphinx sphinx_rtd_theme sphinx-tabs autodoc ipython-genutils
- pip install .
script:
- cd docs
- make clean
- make html
- cd -
artifacts:
paths:
- docs/_build
pages:
stage: deploy
dependencies:
- documentation
script:
- mkdir public/
- mv docs/_build/html/* public/
artifacts:
paths:
- public
expire_in: 30 days
only:
- main