-
Notifications
You must be signed in to change notification settings - Fork 0
295 lines (293 loc) · 10.3 KB
/
build.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
name: Build
on: [push]
permissions:
actions: read
contents: read
jobs:
checkPipelineCode:
environment: build
runs-on: ubuntu-latest
name: Check pipline code
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install checks
run: pip install pycodestyle pyflakes nose2
- name: Install other dependencies
run: pip install -r requirements.txt
- name: Run pyflakes
run: pyflakes *.py
- name: Run pycodestyle
run: pycodestyle *.py
- name: Run unit tests
run: nose2
checkVizCodePython:
environment: build
runs-on: ubuntu-latest
name: Check viz code
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install checks
run: pip install pycodestyle pyflakes nose2
- name: Install other dependencies
run: pip install -r requirements.txt
- name: Run pyflakes
run: pyflakes paper/viz/*.py
- name: Run pycodestyle
run: pycodestyle paper/viz/*.py
- name: Update apt
run: sudo apt-get update
- name: Install zip
run: sudo apt-get install zip
- name: Install wget
run: sudo apt-get install wget
- name: Download pipeline summary outputs
run: wget --user $user --password $pass https://ag-adaptation-study.pub/archive/outputs.zip
env:
user: ${{ secrets.HttpUser }}
pass: ${{ secrets.HttpPass }}
- name: Unzip downloaded summary data
run: unzip outputs.zip
- name: Move downloaded summary data
run: mv outputs paper/outputs
- name: Download pipeline detailed outputs
run: wget --user $user --password $pass https://ag-adaptation-study.pub/archive/data.zip
env:
user: ${{ secrets.HttpUser }}
pass: ${{ secrets.HttpPass }}
- name: Unzip downloaded detailed data
run: unzip data.zip
- name: Move downloaded detailed data
run: mv data paper/viz/data
- name: Make font build dir
run: mkdir font_build
- name: Download font
run: cd font_build; wget https://github.com/uswds/public-sans/releases/download/v2.001/public-sans-v2.001.zip
- name: Unzip font
run: cd font_build; unzip public-sans-v2.001
- name: Make font destination
run: mkdir paper/viz/font
- name: Move font
run: mv font_build/fonts/otf/PublicSans-Regular.otf paper/viz/font/PublicSans-Regular.otf
- name: Install Python deps
run: cd paper/viz; pip install -r requirements.txt
- name: Make destination
run: mkdir paper/img
- name: Render images
run: cd paper/viz; bash render_images.sh
- name: Check images
run: cd paper/viz; bash script/check_images.sh
buildPaper:
environment: build
runs-on: ubuntu-latest
name: Build paper
needs: [checkPipelineCode, checkVizCodePython]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Update apt
run: sudo apt-get update
- name: Install zip
run: sudo apt-get install zip
- name: Install wget
run: sudo apt-get install wget
- name: Download pipeline summary outputs
run: wget --user $user --password $pass https://ag-adaptation-study.pub/archive/outputs.zip
env:
user: ${{ secrets.HttpUser }}
pass: ${{ secrets.HttpPass }}
- name: Unzip downloaded summary data
run: unzip outputs.zip
- name: Move downloaded summary data
run: mv outputs paper/outputs
- name: Download pipeline detailed outputs
run: wget --user $user --password $pass https://ag-adaptation-study.pub/archive/data.zip
env:
user: ${{ secrets.HttpUser }}
pass: ${{ secrets.HttpPass }}
- name: Unzip downloaded detailed data
run: unzip data.zip
- name: Move downloaded detailed data
run: mv data paper/viz/data
- name: Make font build dir
run: mkdir font_build
- name: Download font
run: cd font_build; wget https://github.com/uswds/public-sans/releases/download/v2.001/public-sans-v2.001.zip
- name: Unzip font
run: cd font_build; unzip public-sans-v2.001
- name: Make font destination
run: mkdir paper/viz/font
- name: Move font
run: mv font_build/fonts/otf/PublicSans-Regular.otf paper/viz/font/PublicSans-Regular.otf
- name: Install Python deps
run: cd paper; pip install -r requirements.txt
- name: Install Pandoc deps
run: sudo apt-get install texlive-extra-utils texlive-fonts-recommended texlive-latex-base texlive-latex-extra texlive-bibtex-extra biber
- name: Download Pandoc
run: wget https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-1-amd64.deb
- name: Install Pandoc
run: sudo dpkg -i pandoc-3.1.9-1-amd64.deb
- name: Prep file structure
run: mkdir paper/img
- name: Get static images
run: cd paper/img; wget --user $user --password $pass https://ag-adaptation-study.pub/archive/pipeline.png
env:
user: ${{ secrets.HttpUser }}
pass: ${{ secrets.HttpPass }}
- name: Patch Pandoc deps
run: python -m pip install --force-reinstall git+https://github.com/tomduck/pandoc-xnos@284474574f51888be75603e7d1df667a0890504d#egg=pandoc-xnos
- name: Add other pandoc extensions
run: pip install pandoc-eqnos --user
- name: Build paper
run: cd paper; bash render.sh
- name: Move export arxiv
run: mv paper/arxiv.zip arxiv.zip
- name: Move export arxiv_complete
run: mv paper/arxiv_complete.zip arxiv_complete.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: arxiv
path: arxiv.zip
if-no-files-found: error
- name: Upload arxiv complete
uses: actions/upload-artifact@v4
with:
name: arxiv_complete
path: arxiv_complete.zip
if-no-files-found: error
buildDeploy:
environment: build
runs-on: ubuntu-latest
needs: [checkPipelineCode, checkVizCodePython]
name: Build deploy
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build deploy
run: bash prepare_viz_deploy.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: deploy
path: deploy.zip
if-no-files-found: error
- name: Check build
run: python paper/viz/script/check_deploy.py deploy
buildCard:
environment: build
runs-on: ubuntu-latest
needs: [checkPipelineCode, checkVizCodePython]
name: Build social card
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install other dependencies
run: pip install -r requirements.txt
- name: Update apt
run: sudo apt-get update
- name: Install zip
run: sudo apt-get install zip
- name: Install wget
run: sudo apt-get install wget
- name: Download pipeline summary outputs
run: wget --user $user --password $pass https://ag-adaptation-study.pub/archive/outputs.zip
env:
user: ${{ secrets.HttpUser }}
pass: ${{ secrets.HttpPass }}
- name: Unzip downloaded summary data
run: unzip outputs.zip
- name: Move downloaded summary data
run: mv outputs paper/outputs
- name: Download pipeline detailed outputs
run: wget --user $user --password $pass https://ag-adaptation-study.pub/archive/data.zip
env:
user: ${{ secrets.HttpUser }}
pass: ${{ secrets.HttpPass }}
- name: Unzip downloaded detailed data
run: unzip data.zip
- name: Move downloaded detailed data
run: mv data paper/viz/data
- name: Make font build dir
run: mkdir font_build
- name: Download font
run: cd font_build; wget https://github.com/uswds/public-sans/releases/download/v2.001/public-sans-v2.001.zip
- name: Unzip font
run: cd font_build; unzip public-sans-v2.001
- name: Make font destination
run: mkdir paper/viz/font
- name: Move font
run: mv font_build/fonts/otf/PublicSans-Regular.otf paper/viz/font/PublicSans-Regular.otf
- name: Install Python deps
run: cd paper/viz; pip install -r requirements.txt
- name: Make destination
run: mkdir paper/img
- name: Render images
run: cd paper/viz; bash render_images.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: card
path: paper/img/map.png
if-no-files-found: error
deploy:
environment: deploy
name: Deploy
runs-on: ubuntu-latest
needs: [buildPaper, buildDeploy, buildCard]
if: github.ref == 'refs/heads/main'
steps:
- name: Download deploy
uses: actions/download-artifact@v4
with:
name: deploy
- name: Download paper
uses: actions/download-artifact@v4
with:
name: arxiv
- name: Download card
uses: actions/download-artifact@v4
with:
name: card
- name: Unzip deploy
run: unzip deploy.zip
- name: Unzip paper
run: unzip arxiv.zip
- name: Make destination
run: mkdir deploy/literature
- name: Move paper
run: mv paper_filled.pdf deploy/literature/preprint.pdf
- name: Make social directory
run: mkdir deploy/social
- name: Move card
run: mv map.png deploy/social/map.png
- name: Deploy
uses: Creepios/sftp-action@v1.0.3
with:
host: ${{ secrets.SFTPHOST }}
port: 22
username: ${{ secrets.SFTPUSER }}
password: ${{ secrets.SFTPPASSWORD }}
localPath: './deploy'
remotePath: './ag-adaptation-study.pub'