Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,24 @@ jobs:
java-version: '17'
distribution: 'corretto'
cache: maven
- name: Test Java
run: mvn test

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker Image
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: regmxflib-ci-env:latest
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run Build and Test
run: |
mvn test
docker run --rm \
-v $GITHUB_WORKSPACE:/workspace \
-w /tmp \
regmxflib-ci-env:latest \
bash /workspace/library/src/test/sh/compat.sh
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM ubuntu:22.04

# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive

# Install development tools, dependencies for asdcplib, and ffmpeg
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
ffmpeg \
wget \
libssl-dev \
libxerces-c-dev \
uuid-dev \
libexpat1-dev \
liburiparser-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /tmp

# Clone, build, and install asdcplib
RUN git clone https://github.com/cinecert/asdcplib.git \
&& cd asdcplib \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& make \
&& make install \
&& ldconfig \
&& cd /tmp && rm -rf asdcplib

# Clone, build, and install bmx
RUN git clone https://github.com/ebu/bmx.git \
&& cd bmx \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& make \
&& make install \
&& ldconfig \
&& cd /tmp && rm -rf bmx

# Reset working directory
WORKDIR /root
2 changes: 1 addition & 1 deletion library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M1</version>
<version>3.2.5</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.config.file>log4j.properties</java.util.logging.config.file>
Expand Down
54 changes: 54 additions & 0 deletions library/src/test/sh/compat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash
set -e

run_test() {
local test_name=$1
local file_path=$2

echo "Function: ${test_name}, File: ${file_path}"

case ${test_name} in
"as-02-unwrap")
as-02-unwrap "${file_path}" > /dev/null
;;
"ffmpeg")
ffmpeg -loglevel error -i "${file_path}" -c copy -f null - > /dev/null
;;
"mxf2raw")
mxf2raw --log-level 2 "${file_path}" > /dev/null
;;
*)
echo "Unknown test: ${test_name}" >&2
return 1
;;
esac
}

# Define files to test along with the format:
# "/path/to/file|exclusion1,exclusion2,..."
FILES_TO_TEST=(
"/workspace/library/target/test-output/testVBE.mxf"
"/workspace/library/target/test-output/testCBE.mxf"
"/workspace/library/target/test-output/testClipVBE.mxf|ffmpeg,mxf2raw"
"/workspace/library/target/test-output/testPHDR.mxf"
)

for item in "${FILES_TO_TEST[@]}"; do
file="${item%%|*}"
exclusions=""
if [[ "$item" == *"|"* ]]; then
exclusions="${item#*|}"
fi

if [[ "$exclusions" != *"as-02"* ]]; then
run_test "as-02-unwrap" "${file}"
fi

if [[ "$exclusions" != *"ffmpeg"* ]]; then
run_test "ffmpeg" "${file}"
fi

if [[ "$exclusions" != *"mxf2raw"* ]]; then
run_test "mxf2raw" "${file}"
fi
done