Merge branch 'escapes-for-parse-filter' of JulianKniephoff/opencast i… #1290
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- 17 | |
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: 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 \ | |
--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 == 11 | |
run: | | |
./.github/multi-node-test-setup | |
- name: verify jar file integrity | |
if: matrix.java == 11 | |
run: | | |
.github/test-jars | |
- name: wait for opensearch to boot | |
if: matrix.java == 11 | |
run: > | |
curl -fisS --retry 60 --retry-delay 1 --retry-all-errors | |
http://localhost:9200/ | |
- name: start admin | |
if: matrix.java == 11 | |
run: ./build/opencast-dist-admin/bin/start-opencast daemon & | |
- name: start presentation | |
if: matrix.java == 11 | |
run: ./build/opencast-dist-presentation/bin/start-opencast daemon & | |
- name: start worker | |
if: matrix.java == 11 | |
run: ./build/opencast-dist-worker/bin/start-opencast daemon & | |
- name: test admin | |
if: matrix.java == 11 | |
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 == 11 | |
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 == 11 | |
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 == 11 | |
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 == 11 | |
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 == 11 | |
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 == 11 | |
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 == 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/ | |
- name: prepare allinone for upload | |
if: matrix.java == 11 | |
working-directory: build | |
run: | | |
tar xf opencast-dist-allinone*.tar.gz | |
- name: upload tarball as workflow asset | |
if: > | |
matrix.java == 11 | |
&& github.repository == 'opencast/opencast' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: opencast-allinone | |
path: build/opencast-dist-allinone/ |