-
-
Notifications
You must be signed in to change notification settings - Fork 40
170 lines (154 loc) · 8.07 KB
/
documentation.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Documentation
on:
push:
branches:
- develop
pull_request:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
env:
HAS_SECRETS: ${{ secrets.AWS_SECRET_ACCESS_KEY != '' }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --fix-missing libsqlite3-mod-spatialite libspatialite-dev pandoc
sudo apt-get install latexmk texlive-xetex texlive-latex-extra fonts-freefont-otf xindy
python -m pip install --upgrade pip
pip install wheel openmatrix pytest
pip install -r requirements.txt
pip install -r docs/requirements-docs.txt
- name: Compile library
run: |
python setup.py build_ext --inplace
pip install .
- name: Check history of versions
run: |
python docs/table_documentation.py
python docs/create_docs_data.py
python docs/website/check_documentation_versions.py
- name: Test docstrings
run: |
python -m pytest --doctest-modules aequilibrae/distribution --ignore=aequilibrae/distribution/setup_ipf.py
python -m pytest --doctest-modules aequilibrae/matrix
python -m pytest --doctest-modules aequilibrae/paths --ignore=aequilibrae/paths/setup_assignment.py
python -m pytest --doctest-modules aequilibrae/project
python -m pytest --doctest-modules aequilibrae/log.py aequilibrae/parameters.py
python -m pytest --doctest-modules aequilibrae/transit
python -m pytest --doctest-glob=*.rst docs/source/project_components
python -m pytest --doctest-glob=*.rst docs/source/traffic_assignment
- name: Prepare links for DEV
if: ${{ (github.event_name == 'pull_request') && (env.HAS_SECRETS == 'true') }}
run: |
python -c "from docs.replace_regex import replace_regex; replace_regex(f'dev/{${{ github.event.number }}}')"
- name: Prepare links for DEVELOP
if: ${{ (github.ref == 'refs/heads/develop') && (github.event_name == 'push')}}
run: |
python -c "from docs.replace_regex import replace_regex; replace_regex('develop')"
- name: Build documentation
run: |
jupyter nbconvert --to rst docs/source/distribution_procedures/IPF_benchmark.ipynb
sphinx-build -M latexpdf docs/source docs/source/_static -D plot_gallery=False
sphinx-build -D plot_gallery=False -b html docs/source docs/build
python -m zipfile -c AequilibraE.zip docs/build
cp AequilibraE.zip docs/source/_static
cp large_icon.png docs/source/_static/large_icon.png
cd docs
make html
- name: Upload python to DEV on S3
if: ${{ (github.event_name == 'pull_request') && (env.HAS_SECRETS == 'true') }}
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete --exclude 'home.html'
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: 'docs/build/html/' # optional: defaults to entire repository
DEST_DIR: 'dev/${{ github.event.number }}/python/' # optional: defaults to entire repository
- name: Upload home page to DEV on S3
if: ${{ (github.event_name == 'pull_request') && (env.HAS_SECRETS == 'true') }}
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --exclude '*' --include 'home.html' --include '_images/sponsor*' --include '_images/banner*' --include '_static/*' --include 'search*' --include 'genindex.html' --include '_sphinx_design_static/*'
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: 'docs/build/html/'
DEST_DIR: 'dev/${{ github.event.number }}/' # optional: defaults to entire repository
- name: Upload python to DEVELOP on S3
if: ${{ (github.ref == 'refs/heads/develop') && (github.event_name == 'push') && (env.HAS_SECRETS == 'true') }}
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete --exclude 'home.html'
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: 'docs/build/html/' # optional: defaults to entire repository
DEST_DIR: 'develop/python/' # optional: defaults to entire repository
- name: Upload home page to DEVELOP on S3
if: ${{ (github.ref == 'refs/heads/develop') && (github.event_name == 'push') && (env.HAS_SECRETS == 'true') }}
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --exclude '*' --include 'home.html' --include '_images/sponsor*' --include '_images/banner*' --include '_static/*' --include 'search*' --include 'genindex.html' --include '_sphinx_design_static/*'
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: 'docs/build/html/'
DEST_DIR: 'develop/' # optional: defaults to entire repository
- name: Upload python to LATEST on S3
if: ${{ (github.event_name == 'release') && (env.HAS_SECRETS == 'true') }}
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete --exclude 'home.html'
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: 'docs/build/html/' # optional: defaults to entire repository
DEST_DIR: 'latest/python/' # optional: defaults to entire repository
- name: Upload home page to LATEST on S3
if: ${{ (github.event_name == 'release') && (env.HAS_SECRETS == 'true') }}
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --exclude '*' --include 'home.html' --include '_images/sponsor*' --include '_images/banner*' --include '_static/*' --include 'search*' --include 'genindex.html' --include '_sphinx_design_static/*'
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: 'docs/build/html/'
DEST_DIR: 'latest/' # optional: defaults to entire repository
- name: Create Documentation history folder
if: ${{ github.event_name == 'release'}}
run: python docs/website/redir.py
- name: Upload documentation to history folder
if: ${{ (github.event_name == 'release') && (env.HAS_SECRETS == 'true') }}
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --exclude '*.py'
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: 'docs/website/' # optional: defaults to entire repository
DEST_DIR: 'docs/python/' # optional: defaults to entire repository