forked from opencast/opencast
-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (145 loc) · 5.18 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
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:
- 11
- 13
name: build (java ${{ matrix.java }})
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: cache local maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: setup java
uses: actions/setup-java@v1
with:
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: prepare build
run: |
sed -i 's/build --skipTests=${skipTests}/build --skipTests=true/' modules/admin-ui-frontend/pom.xml
- 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 == 11
working-directory: assemblies
run: |
mvn clean install -Pallinone \
--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 allinone distribution
if: matrix.java == 11
working-directory: build
run: |
tar xf opencast-dist-allinone*.tar.gz
- name: prepare runtime dependencies
if: matrix.java == 11
working-directory: docs/scripts/devel-dependency-containers
run: |
docker-compose up -d
- name: get new curl
if: matrix.java == 11
run: |
curl -OL https://github.com/moparisthebest/static-curl/releases/download/v7.77.0/curl-amd64
chmod +x curl-amd64
- name: wait for elasticsearch to boot
if: matrix.java == 11
run: >
./curl-amd64 -fisS --retry 60 --retry-delay 1 --retry-all-errors
http://localhost:9200/
- name: integration test
if: matrix.java == 11
run: |
./build/opencast-dist-allinone/bin/start-opencast daemon &
./curl-amd64 -fisS --retry 30 --retry-delay 10 --retry-all-errors -u admin:opencast http://localhost:8080/sysinfo/bundles/version
- name: show logs on failure
if: ${{ failure() }}
run: cat build/opencast-dist-allinone/data/log/opencast.log || true
- name: save version
working-directory: build
if: >
github.event_name == 'push'
&& matrix.java == 11
&& 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 == 11
&& 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 == 11
&& 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/