-
Notifications
You must be signed in to change notification settings - Fork 35
225 lines (197 loc) · 8.05 KB
/
ant.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
# 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
on:
push:
branches: [ "master", "main" ]
pull_request:
branches: [ "master", "main" ]
env:
DEFAULT_DOCKER_ACCOUNT: apease
jobs:
build:
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 sumo
uses: actions/checkout@v4
with:
repository: 'ontologyportal/sumo'
path: sumo
- name: Setup SigmaKEE
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 $SIGMA_SRC/config.xml $SIGMA_HOME/KBs
cp -R $ONTOLOGYPORTAL_GIT/sumo/* $SIGMA_HOME/KBs
cp /opt/WordNet-3.0/dict/* $SIGMA_HOME/KBs/WordNetMappings/
sed -i "s|/home/theuser/.sigmakee|$SIGMA_HOME|g" $SIGMA_HOME/KBs/config.xml
sed -i "s|/home/theuser/workspace/sumo|$ONTOLOGYPORTAL_GIT/sumo|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
- 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 }}
run: ant
working-directory: ./sigmakee
- 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/apease/.sigmakee|$SIGMA_HOME|g" $SIGMA_SRC/test/unit/java/resources/config_topOnly.xml
sed -i "s|/home/apease/workspace/sumo|$ONTOLOGYPORTAL_GIT/sumo|g" $SIGMA_SRC/test/unit/java/resources/config_topOnly.xml
sed -i "s|/home/apease/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/apease/workspace/vampire/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 }}
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 }}
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/.sigmakee|$SIGMA_HOME|g" $SIGMA_HOME/KBs/config.xml
sed -i "s|/home/theuser/workspace/sumo|$ONTOLOGYPORTAL_GIT/sumo|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/workspace/vampire/vampire|/usr/local/bin/vampire|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
SIGMA_SRC: ${{ github.workspace }}/sigmakee
ONTOLOGYPORTAL_GIT: ${{ github.workspace }}
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 }}
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
rm -rf $SIGMA_HOME/KBs/tests
- name: Upload sigmakee jars
uses: actions/upload-artifact@v4
with:
path: |
./sigmakee/build/WEB-INF/lib/*.jar
./sigmakee/build/sigmakee.jar
./sigmakee/config.xml
./sigmakee-runtime
- name: Upload sigmakee war
uses: actions/upload-artifact@v4
with:
name: sigma-webapp
path: /usr/local/tomcat/webapps/sigma.war
build-sumo-ci:
runs-on: ubuntu-latest
needs: build
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/[email protected]
with:
name: artifact
- name: Download artifact
uses: actions/[email protected]
with:
name: sigma-webapp
- name: Setup SigmaKEE
run: |
ls .
sed -i "s|/home/theuser/.sigmakee|/root/sigmakee-runtime|g" ./sigmakee/config.xml
sed -i "s|/home/theuser/workspace/vampire/vampire|/usr/local/bin/vampire|g" ./sigmakee/config.xml
sed -i "s|/home/theuser/E/bin/e_ltb_runner|/usr/local/bin/e_ltb_runner|g" ./sigmakee/config.xml
cp ./sigmakee/config.xml ./sigmakee-runtime/KBs
- 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
build-args: |
IMAGE_ACCOUNT=${{ env.IMAGE_ACCOUNT }}
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
build-args: |
IMAGE_ACCOUNT=${{ env.IMAGE_ACCOUNT }}
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