This repository has been archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
142 lines (125 loc) · 3.03 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# https://git.ligo.org/lscsoft/example-ci-project/wikis/automatically-produce-documentation
# https://wiki.ligo.org/viewauth/DASWG/GitLigoOrg#Accessing_GitLab_Pages
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
cache:
paths:
- .cache/
stages:
- test
- deploy
.template:test:unit: &template-test-unit
script:
- python --version
- apt update -qy
- apt install --assume-yes python-pip
- pip install .
- make test-unit
.template:test:integration: &template-test-integration
script:
- python --version
- apt update -qy
- apt install --assume-yes python-pip
- pip install .
- make test-integration
.template:test:validation: &template-test-validation
only:
variables:
- $LISO_GIT_ARCHIVE_ACCESS_TOKEN
- $LISO_GIT_ARCHIVE_URL
script:
- mkdir liso
- cd liso
- wget -O liso.tar.gz ${LISO_GIT_ARCHIVE_URL}
- tar -xvf liso.tar.gz -C . --wildcards liso-linux*/ --strip-components=1
- chmod +x fil_static
- cd ..
- export LISO_DIR=$(pwd)/liso
- export LISO_PATH=$LISO_DIR/fil_static
- python --version
- apt update -qy
- apt install --assume-yes python-pip
- pip install .
- make test-validation
test unit:latest:
image: python:latest
stage: test
<<: *template-test-unit
test unit:3.6:
image: python:3.6
stage: test
<<: *template-test-unit
test unit:3.7:
image: python:3.7
stage: test
<<: *template-test-unit
test integration:latest:
image: python:latest
stage: test
<<: *template-test-integration
test integration:3.6:
image: python:3.6
stage: test
<<: *template-test-integration
test integration:3.7:
image: python:3.7
stage: test
<<: *template-test-integration
test validation:latest:
image: python:latest
stage: test
<<: *template-test-validation
test validation:3.6:
image: python:3.6
stage: test
<<: *template-test-validation
test validation:3.7:
image: python:3.7
stage: test
<<: *template-test-validation
# Generate the documentation only on creation of new tags.
pages:
image: python:3.8
stage: deploy
only:
refs:
- tags
variables:
- $LISO_GIT_ARCHIVE_ACCESS_TOKEN
- $LISO_GIT_ARCHIVE_URL
script:
- mkdir liso
- cd liso
- wget -O liso.tar.gz ${LISO_GIT_ARCHIVE_URL}
- tar -xvf liso.tar.gz -C . --wildcards liso-linux*/ --strip-components=1
- chmod +x fil_static
- cd ..
- export LISO_DIR=$(pwd)/liso
- export LISO_PATH=$LISO_DIR/fil_static
- python --version
- apt update -qy
- apt install --assume-yes python-pip
- pip install .[dev]
- cd docs
- make html
- mv _build/html ../public
artifacts:
paths:
- public
# Generate PyPI release only on creation of new tags.
pypi:
image: python:3.8
stage: deploy
only:
refs:
- tags
variables:
- $TWINE_USERNAME
- $TWINE_PASSWORD
script:
- python --version
- apt update -qy
- apt install --assume-yes python-pip
- pip install twine
- python setup.py sdist bdist_wheel
- python -m twine upload dist/zero-*