-
Notifications
You must be signed in to change notification settings - Fork 0
270 lines (230 loc) · 10.3 KB
/
1603_16.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
#===============================================================================
#
# FILE: 1603_16.yml
#
# USAGE: - See https://docs.github.com/en/actions
# /learn-github-actions/understanding-github-actions
# - Add .github/workflows/1603_16.yml to repository. This will
# not work for forks
# - Setup SSH_PRIVATE_KEY__ID_ED25519__GITHUBRUNNER2022
# for your agent (such as @eticaaibot)
#
# DESCRIPTION: Quick introduction:
#
# 1. This action runs the 1603_16 namespace from
# https://github.com/EticaAI/lexicographi-sine-finibus.
# 2. All operations can be done using a local account (see
# the shell files at officina/999999999) without emulating
# entire GitHub runner (aka https://github.com/nektos/act)
# 3. Very few operations (even for boostrapping 1603_16)
# are not here (but are on shell script): they're mostly
# to create very first time the repositories with data, so
# you really not need then unless you're recreating from
# zero (which may never be necessary)
# 4. Some operations that could be done by requesting the
# shell scripts locally (but are easier to do with YAML
# on GitHub Actions runner) may be done here without calling
# the shell scripts.
#
# OPTIONS: ---
#
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Emerson Rocha <rocha[at]ieee.org>
# COMPANY: EticaAI
# LICENSE: Public Domain dedication or Zero-Clause BSD
# SPDX-License-Identifier: Unlicense OR 0BSD
# VERSION: v1.0
# CREATED: 2022-06-16 21:38 UTC started.
# REVISION: ---
#===============================================================================
# SPDX-License-Identifier: Unlicense OR 0BSD
# @TODO eventually make it run weekly
# @TODO organize log messages when running on github actions to allow be grouped
# docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
# @TODO test gh (github cli). Maybe tehre is less verbose way to sync the
# repositories than editing 'git commit' directly.
# docs.github.com/en/actions/using-workflows/using-github-cli-in-workflows
# @TODO about reusable workflows
# - https://dev.to/n3wt0n/avoid-duplication-github-actions-reusable-workflows-3ae8
# - https://www.youtube.com/watch?v=4lH_7b5lmjo
# - https://github.com/n3wt0n/ReusableWorkflow/blob/main/.github/workflows/buildAndPublishDockerImage.yml
# - https://github.com/n3wt0n/ActionsTest/blob/main/.github/workflows/reusableWorkflowsUser.yml
# - https://docs.github.com/en/actions/using-workflows/using-github-cli-in-workflows
# - https://free-for.dev/#/?id=source-code-repos
name: "aN1603_16"
on:
push:
branches:
- main
env:
# Fix: 'tput: No value for $TERM and no -T specified'
TERM: xterm
AUTOMATON__1603_16__CPLP_UNICAE: "1"
# AUTOMATON__1603_16__CPLP_UNICAE: "0"
# When running too many git clones at once, the scripts will
# default to ARTIFICIAL_THROTTLING=1 (1 second). Next part force higher time.
ARTIFICIAL_THROTTLING: 0
# AUTOMATON__1603_16__CPLP_UNICAE="0", define range of UN M49 to operate
# UNM49_INITIALI: 700
# UNM49_FINALI: 999
# UNM49_INITIALI: 400
# UNM49_FINALI: 700
# UNM49_INITIALI: 100
# UNM49_FINALI: 400
defaults:
run:
working-directory: ./officina
jobs:
"aN1603_16":
name: aN1603_16
runs-on: ubuntu-latest
continue-on-error: true
steps:
#### Low level ssh-agent _________________________________________________
# @see https://github.com/marketplace/actions/webfactory-ssh-agent
# REASONING: this is not necessary for read-only requests to public
# repositories, but for use GitHub Actions runner, we need
# something far more dynamic than write YAML for every
# repository we would create with shell scripting
- name: ID_ED25519__GITHUBRUNNER2022
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY__ID_ED25519__GITHUBRUNNER2022 }}
# - run: ssh -T [email protected]
# continue-on-error: true
#### Fetch data __________________________________________________________
- name: EticaAI/MDCIII-boostrapper
uses: actions/checkout@v3
- name: EticaAI/lexicographi-sine-finibus
uses: actions/checkout@v3
with:
repository: EticaAI/lexicographi-sine-finibus
path: officina/999999/3133368/lexicographi-sine-finibus
- name: MDCIII/999999_1603_16
uses: actions/checkout@v3
continue-on-error: true
with:
repository: MDCIII/999999_1603_16
path: officina/999999/3133368/999999_1603_16
# Debug part, remove later, START
- run: pwd
- run: find * -type f
continue-on-error: true
# Debug part, remove later, END
- name: "Merge 999999 [MDCIII/999999_1603_16 -> EticaAI/lexicographi-sine-finibus]"
run: >
rsync --verbose --human-readable --checksum --recursive
999999/3133368/999999_1603_16/999999/
999999/3133368/lexicographi-sine-finibus/officina/999999
continue-on-error: true
# - name: "Merge 999999 [MDCIII/999999_1603_16 -> EticaAI/lexicographi-sine-finibus]"
# run: rsync --dry-run --verbose --human-readable --checksum --recursive officina/999999/3133368/999999_1603_16/999999/ officina/999999/3133368/lexicographi-sine-finibus/officina/999999
# continue-on-error: true
# Debug part, remove later, START
- run: pwd
- run: ls -lha
- run: ls -lha 999999/
continue-on-error: true
- run: ls -lha 999999/3133368/
continue-on-error: true
- run: find * -type f
continue-on-error: true
# Debug part, remove later, END
### Symlinks
- name: officina/1603
run: >
ln --relative --symbolic
999999/3133368/lexicographi-sine-finibus/officina/1603
1603
continue-on-error: true
- name: officina/999999/1603
run: >
ln --relative --symbolic
999999/3133368/lexicographi-sine-finibus/officina/999999/1603
999999/1603
continue-on-error: true
- name: officina/999999999/0
run: >
ln --relative --symbolic
999999/3133368/lexicographi-sine-finibus/officina/999999999/0
999999999/0
continue-on-error: true
# 1603_1_99 is not stored with main repository, but is required by
# scripts that generate Codex. For now we're simply downloading
# from the older EticaAI/lsf-cache/ repository
- name: "Temporary fix [1603/1/99/1603_1_99.no1.tm.hxl.csv]"
run: >
curl --output 1603/1/99/1603_1_99.no1.tm.hxl.csv
https://raw.githubusercontent.com/EticaAI/lsf-cache/main/1603/1/99/1603_1_99.no1.tm.hxl.csv
continue-on-error: true
- name: "Temporary fix [999999/1603/45/16/1603_45_16.index.hxl.csv]"
run: >
curl --output 999999/1603/45/16/1603_45_16.index.hxl.csv
https://raw.githubusercontent.com/EticaAI/lsf-cache/main/999999/1603/45/16/1603_45_16.index.hxl.csv
continue-on-error: true
- run: ls -lha 1603/1/99/1603_1_99.no1.tm.hxl.csv
continue-on-error: true
- run: ls -lha 999999/1603/45/16/1603_45_16.index.hxl.csv
continue-on-error: true
#### Python ______________________________________________________________
# @see https://github.com/actions/setup-python
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
# - run: pip install libhxl hxltm-eticaai openpyxl frictionless csvkit
# - run: pip install -r .github/requirements.txt
- run: pip install -r ../.github/requirements.txt
continue-on-error: true
#### Java Setup __________________________________________________________
# @see https://github.com/marketplace/actions/setup-java-jdk
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
### Apache Jena ----------------------------------------------------------
# @see https://github.com/foooomio/setup-jena
- uses: foooomio/setup-jena@v2
- run: sparql --version
### Rapper (tool for work with low level RDF) ----------------------------
- run: sudo apt-get install -y raptor2-utils
continue-on-error: true
#### Debug _______________________________________________________________
# _[por-Latn] Lista arquivos locais (útil para saber o que fazer upload [por-Latn]_
- run: ls -lha
# tree-like command for macos, @see https://superuser.com/questions/359723/mac-os-x-equivalent-of-the-ubuntu-tree-command
- run: find * -type f
- run: hxltmcli --version
continue-on-error: true
- run: riot --version
continue-on-error: true
- run: frictionless --version
continue-on-error: true
- run: rsync --version
continue-on-error: true
### Debug, internal tools from lexicographi-sine-finibus
- run: ./999999999/0/1603_1.py --help
continue-on-error: true
- run: ./999999999/0/999999999_7200235.py --help
continue-on-error: true
- run: ./999999999/0/1603_3_12.py --help
continue-on-error: true
#### ssh keys
# @see https://github.com/webfactory/ssh-agent
# SSH_PRIVATE_KEY__ID_ED25519__GITHUBRUNNER2022
# - run: ssh -T [email protected]
# continue-on-error: true
# @TODO beyond bare 'git', also configure gh (GitHub CLI) to use the
# machine operator like @eticaaibot, not the human user. See
# docs.github.com/pt/actions/using-workflows/using-github-cli-in-workflows
### 1603_16 ----------------------------------------------------------
- run: ls -lha 999999/1603/45/16/
continue-on-error: true
- run: ls -lha 999999/1603/45/16/1603_45_16.index.hxl.csv
continue-on-error: true
- run: ./999999999/999999_1603_16.workflow.sh
continue-on-error: true
- run: ./999999999/1603_16.workflow.sh
continue-on-error: true