forked from opencast/opencast
-
Notifications
You must be signed in to change notification settings - Fork 0
236 lines (208 loc) · 7.51 KB
/
test-opencast-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
name: Test Opencast
on:
pull_request:
paths:
- 'pom.xml'
- 'modules/**'
- 'docs/checkstyle/**'
- 'docs/log4j/**'
- 'assemblies/**'
- '.github/**'
push:
paths:
- 'pom.xml'
- 'modules/**'
- 'docs/checkstyle/**'
- 'docs/log4j/**'
- 'assemblies/**'
- '.github/**'
branches-ignore:
- 'dependabot/**' # Don't run dependabot branches, as they are already covered by pull requests
jobs:
build:
strategy:
matrix:
java:
- 17
- 21
name: build (java ${{ matrix.java }})
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: cache local maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: install dependencies
run: |
sudo apt update -q
sudo apt install -y -q \
bzip2 \
ffmpeg \
gzip \
hunspell \
hunspell-de-de \
procps \
s3cmd \
sox \
tar \
tesseract-ocr \
tesseract-ocr-deu \
unzip
- name: build opencast
run: |
mvn clean install -Pnone \
--batch-mode \
-Dsurefire.rerunFailingTestsCount=2 \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-Dhttp.keepAlive=false \
-Dmaven.wagon.http.pool=false \
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
- name: build assemblies
if: matrix.java == 17
working-directory: assemblies
run: |
mvn clean install \
--batch-mode \
-Dsurefire.rerunFailingTestsCount=2 \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-Dhttp.keepAlive=false \
-Dmaven.wagon.http.pool=false \
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
- name: prepare cluster
if: matrix.java == 17
run: |
./.github/multi-node-test-setup
- name: verify jar file integrity
if: matrix.java == 17
run: |
.github/test-jars
- name: wait for opensearch to boot
if: matrix.java == 17
run: >
curl -fisS --retry 60 --retry-delay 1 --retry-all-errors
http://localhost:9200/
- name: start admin
if: matrix.java == 17
run: ./build/opencast-dist-admin/bin/start-opencast daemon &
- name: start presentation
if: matrix.java == 17
run: ./build/opencast-dist-presentation/bin/start-opencast daemon &
- name: start worker
if: matrix.java == 17
run: ./build/opencast-dist-worker/bin/start-opencast daemon &
- name: test admin
if: matrix.java == 17
run: >
curl -fisS --retry 30 --retry-delay 10 --retry-all-errors -u admin:opencast
http://localhost:8080/sysinfo/bundles/version
- name: test presentation
if: matrix.java == 17
run: >
curl -fisS --retry 30 --retry-delay 10 --retry-all-errors -u admin:opencast
http://localhost:8081/sysinfo/bundles/version
- name: test worker
if: matrix.java == 17
run: >
curl -fisS --retry 30 --retry-delay 10 --retry-all-errors -u admin:opencast
http://localhost:8082/sysinfo/bundles/version
- name: create test user
if: matrix.java == 17
run: >
curl -i -u admin:opencast http://localhost:8080/user-utils/
-F username=test
-F password=opencast
-F 'roles=["ROLE_STUDIO"]'
- name: ingest test media as non-admin
if: matrix.java == 17
run: >
curl -i -f -u test:opencast http://localhost:8080/ingest/addMediaPackage/fast
-F flavor=presenter/source
-F BODY=@modules/inspection-service-ffmpeg/src/test/resources/segments_1.mp4
-F title=test
-F identifier=test
-F acl='{"acl": {"ace": [{"role": "ROLE_USER","action": "read"},{"role": "ROLE_USER","action": "write"}]}}'
- name: wait for event to finish
if: matrix.java == 17
env:
STATUS_URL: 'http://localhost:8080/workflow/mediaPackage/test/hasActiveWorkflows'
run: |
while [ "$(curl -s -u admin:opencast "${STATUS_URL}")" = "true" ]
do
sleep 1
echo -n .
done
- name: check that processing was successful
if: matrix.java == 17
run: |
curl -s -O -u admin:opencast http://localhost:8080/workflow/mediaPackage/test/instances.json
jq < instances.json
jq -r '.workflows.workflow.state' < instances.json | tee status
grep -q SUCCEEDED status
- name: show admin logs
if: always()
run: cat build/opencast-dist-admin/data/log/opencast.log || true
- name: show presentation logs
if: always()
run: cat build/opencast-dist-presentation/data/log/opencast.log || true
- name: show worker logs
if: always()
run: cat build/opencast-dist-worker/data/log/opencast.log || true
- name: save version
working-directory: build
if: >
github.event_name == 'push'
&& matrix.java == 17
&& github.repository == 'opencast/opencast'
&& (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/r/'))
run: |
git log -n1 > "$(echo "${GITHUB_REF#refs/heads/}" | sed 's#/#_#').commit"
- name: configure s3cmd
if: >
github.event_name == 'push'
&& matrix.java == 17
&& github.repository == 'opencast/opencast'
&& (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/r/'))
env:
S3_HOST: ${{ secrets.S3_HOST }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
run: |
echo "host_base = ${S3_HOST}" > "$HOME/.s3cfg"
echo "host_bucket = ${S3_HOST}" >> "$HOME/.s3cfg"
echo "bucket_location = us-east-1" >> "$HOME/.s3cfg"
echo "use_https = True" >> "$HOME/.s3cfg"
echo "access_key = ${S3_ACCESS_KEY}" >> "$HOME/.s3cfg"
echo "secret_key = ${S3_SECRET_KEY}" >> "$HOME/.s3cfg"
echo "signature_v2 = False" >> "$HOME/.s3cfg"
- name: upload assets
working-directory: build
if: >
github.event_name == 'push'
&& matrix.java == 17
&& github.repository == 'opencast/opencast'
&& (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/r/'))
run: |
s3cmd put -P *.commit opencast-dist-allinone*tar.gz s3://opencast-daily/
- name: prepare allinone for upload
if: matrix.java == 17
working-directory: build
run: |
tar xf opencast-dist-allinone*.tar.gz
- name: upload tarball as workflow asset
if: >
matrix.java == 17
&& github.repository == 'opencast/opencast'
uses: actions/upload-artifact@v4
with:
name: opencast-allinone
path: build/opencast-dist-allinone/
overwrite: true