-
Notifications
You must be signed in to change notification settings - Fork 39
326 lines (285 loc) · 10.7 KB
/
Copy pathant.yml
File metadata and controls
326 lines (285 loc) · 10.7 KB
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# This workflow will build a Java project with Ant
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-ant
name: 'Java CI with Ant / Build sumo-ci'
on:
push:
branches: [ "master", "main" ]
pull_request:
branches: [ "master", "main" ]
workflow_dispatch:
env:
DEFAULT_DOCKER_ACCOUNT: apease
SUMO_REF: 5051a4ebf1a8d1c00e602bcdabaa7b5bd3a5ed1c
jobs:
build-test-upload:
name: Build & Test
runs-on: ubuntu-latest
container:
image: apease/sigma-ci:latest
steps:
- name: checkout sigmakee
uses: actions/checkout@v4
with:
path: sigmakee
- name: checkout TPTP-ANTLR
uses: actions/checkout@v4
with:
repository: 'ontologyportal/TPTP-ANTLR'
path: TPTP-ANTLR
- name: checkout SigmaUtils
uses: actions/checkout@v4
with:
repository: 'ontologyportal/SigmaUtils'
path: SigmaUtils
- name: checkout sigmaAntlr
uses: actions/checkout@v4
with:
repository: 'ontologyportal/sigmaAntlr'
path: sigmaAntlr
- name: checkout sumo
uses: actions/checkout@v4
with:
repository: 'ontologyportal/sumo'
ref: ${{ env.SUMO_REF }}
path: sumo
fetch-depth: 0
- name: Setup SIGMA_HOME
env:
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime
SIGMA_SRC: ${{ github.workspace }}/sigmakee
ONTOLOGYPORTAL_GIT: ${{ github.workspace }}
working-directory: ${{ github.workspace }}
run: |
echo "SIGMA_HOME: $SIGMA_HOME"
echo "SIGMA_SRC: $SIGMA_SRC"
echo "ONTOLOGYPORTAL_GIT: $ONTOLOGYPORTAL_GIT"
mkdir -p $SIGMA_HOME/KBs/WordNetMappings
cp -R $ONTOLOGYPORTAL_GIT/sumo/* $SIGMA_HOME/KBs
cp /opt/WordNet-3.0/dict/* $SIGMA_HOME/KBs/WordNetMappings/
- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Build with Ant
env:
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime
SIGMA_SRC: ${{ github.workspace }}/sigmakee
ONTOLOGYPORTAL_GIT: ${{ github.workspace }}
working-directory: ./sigmakee
run: ant
- name: Prepare test env
env:
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime
SIGMA_SRC: ${{ github.workspace }}/sigmakee
ONTOLOGYPORTAL_GIT: ${{ github.workspace }}
working-directory: ./sigmakee
run: |
sed -i "s|/home/theuser/workspace/sumo|$SIGMA_HOME/KBs|g" $SIGMA_SRC/test/unit/java/resources/config_topOnly.xml
sed -i "s|/home/theuser/.sigmakee|$SIGMA_HOME|g" $SIGMA_SRC/test/unit/java/resources/config_topOnly.xml
sed -i "s|/home/theuser/E/bin/e_ltb_runner|/usr/local/bin/e_ltb_runner|g" $SIGMA_SRC/test/unit/java/resources/config_topOnly.xml
sed -i "s|/home/theuser/Programs/vampire/build/vampire|/usr/local/bin/vampire|g" $SIGMA_SRC/test/unit/java/resources/config_topOnly.xml
- name: Run unit tests
env:
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime
SIGMA_SRC: ${{ github.workspace }}/sigmakee
ONTOLOGYPORTAL_GIT: ${{ github.workspace }}
TPTP_BG_WAIT: "true"
working-directory: ./sigmakee
run: |
ant test.unit
- name: Setup SIGMA_HOME for integration tests
env:
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime
SIGMA_SRC: ${{ github.workspace }}/sigmakee
ONTOLOGYPORTAL_GIT: ${{ github.workspace }}
TPTP_BG_WAIT: "true"
working-directory: ${{ github.workspace }}
run: |
find $SIGMA_HOME/KBs -name '**/*.ser' -delete
cp $SIGMA_SRC/config.xml $SIGMA_HOME/KBs
sed -i "s|/home/theuser/workspace/sumo|$SIGMA_HOME/KBs|g" $SIGMA_HOME/KBs/config.xml
sed -i "s|/home/theuser/.sigmakee|$SIGMA_HOME|g" $SIGMA_HOME/KBs/config.xml
sed -i "s|/home/theuser/E/bin/e_ltb_runner|/usr/local/bin/e_ltb_runner|g" $SIGMA_HOME/KBs/config.xml
sed -i "s|/home/theuser/Programs/vampire/build/vampire|/usr/local/bin/vampire|g" $SIGMA_HOME/KBs/config.xml
sed -i "s|/home/theuser|/root|g" $SIGMA_HOME/KBs/config.xml
sed -i '/<kb name/,/<\/kb>/d' $SIGMA_HOME/KBs/config.xml
- name: Setup KB for integration tests
env:
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime
TPTP_BG_WAIT: "true"
working-directory: ${{ github.workspace }}
run: >
sed -i '/<\/configuration>/i\
<kb name="SUMO">\n
<constituent filename="Merge.kif"\/>\n
<constituent filename="Mid-level-ontology.kif"\/>\n
<constituent filename="english_format.kif"\/>\n
<constituent filename="domainEnglishFormat.kif"\/>\n
<\/kb>' $SIGMA_HOME/KBs/config.xml
- name: Run integration tests
env:
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime
SIGMA_SRC: ${{ github.workspace }}/sigmakee
ONTOLOGYPORTAL_GIT: ${{ github.workspace }}
TPTP_BG_WAIT: "true"
working-directory: ./sigmakee
run: |
ant test.integration
- name: Prune KB after integration tests
env:
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime
working-directory: ${{ github.workspace }}
run: |
find $SIGMA_HOME/KBs -name '**/*.ser' -delete
- name: Upload Test Results
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
./sigmakee/build/test/results/*
- name: Upload sigmakee jars
uses: actions/upload-artifact@v4
with:
name: sigma-base
path: |
./sigmakee/build/sigmakee.jar
./sigmakee/lib/*.jar
!./sigmakee/lib/hamcrest-core*.jar
!./sigmakee/lib/junit*.jar
./sigmakee-runtime
- name: Upload sigmakee war
uses: actions/upload-artifact@v4
with:
name: sigma-webapp
path: /usr/local/tomcat/webapps/sigma.war
build-related-repos:
name: Build related repos
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
container:
image: apease/sigma-ci:latest
steps:
- name: checkout sigmakee
uses: actions/checkout@v4
with:
path: sigmakee
- name: checkout TPTP-ANTLR
uses: actions/checkout@v4
with:
repository: ontologyportal/TPTP-ANTLR
path: TPTP-ANTLR
- name: checkout SigmaUtils
uses: actions/checkout@v4
with:
repository: ontologyportal/SigmaUtils
path: SigmaUtils
- name: checkout sigmaAntlr
uses: actions/checkout@v4
with:
repository: ontologyportal/sigmaAntlr
path: sigmaAntlr
- name: checkout SUMOjEdit
uses: actions/checkout@v4
with:
repository: ontologyportal/SUMOjEdit
path: SUMOjEdit
- name: checkout sigmanlp
uses: actions/checkout@v4
with:
repository: ontologyportal/sigmanlp
path: sigmanlp
- name: checkout sumo
uses: actions/checkout@v4
with:
repository: ontologyportal/sumo
ref: ${{ env.SUMO_REF }}
path: sumo
fetch-depth: 0
- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup SIGMA_HOME
env:
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime
ONTOLOGYPORTAL_GIT: ${{ github.workspace }}
working-directory: ${{ github.workspace }}
run: |
mkdir -p "$SIGMA_HOME/KBs/WordNetMappings"
cp -R "$ONTOLOGYPORTAL_GIT/sumo/"* "$SIGMA_HOME/KBs/"
cp /opt/WordNet-3.0/dict/* "$SIGMA_HOME/KBs/WordNetMappings/"
- name: Build related repos
env:
SIGMA_SRC: ${{ github.workspace }}/sigmakee
ONTOLOGYPORTAL_GIT: ${{ github.workspace }}
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime
CATALINA_HOME: /usr/local/tomcat
SIGMA_CP: ${{ github.workspace }}/sigmakee/build/sigmakee.jar:${{ github.workspace }}/sigmakee/lib/*
working-directory: ./sigmakee
run: |
chmod +x scripts/build-related-repos.sh
bash scripts/build-related-repos.sh
build-sumo-ci-and-sigmakee:
runs-on: ubuntu-latest
needs: build-test-upload
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact
uses: actions/download-artifact@v4.1.7
with:
name: sigma-base
- name: Download artifact
uses: actions/download-artifact@v4.1.7
with:
name: sigma-webapp
- name: Setup config
run: |
ls .
# Debug
#cat ./sigmakee-runtime/KBs/config.xml
sed -i "s|/__w/sigmakee/sigmakee|/root|g" ./sigmakee-runtime/KBs/config.xml
# Debug
#cat ./sigmakee-runtime/KBs/config.xml
- name: Set image account name
env:
DOCKER_ACCOUNT: ${{ secrets.DOCKERHUB_USERNAME }}
run: |
echo "IMAGE_ACCOUNT=${DOCKER_ACCOUNT:-$DEFAULT_DOCKER_ACCOUNT}" >> $GITHUB_ENV
- name: Build and push sumo-ci
uses: docker/build-push-action@v6
with:
context: .
file: docker/sumo-ci/Dockerfile
push: ${{ github.event_name == 'push' }}
tags: ${{ env.IMAGE_ACCOUNT }}/sumo-ci:latest
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push sigmakee
uses: docker/build-push-action@v6
with:
context: .
file: docker/sigmakee/Dockerfile
push: ${{ github.event_name == 'push' }}
tags: ${{ env.IMAGE_ACCOUNT }}/sigmakee:latest
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Docker Hub Description
if: github.event_name == 'push'
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ env.IMAGE_ACCOUNT }}/sigmakee