Skip to content

Muxing Refactor and Coverage #273

Muxing Refactor and Coverage

Muxing Refactor and Coverage #273

Workflow file for this run

name: Builds + Unit Tests
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
workflow_dispatch:
env:
BUILD_TYPE: Release
TEST_TYPE: CI_TEST
GENERATOR: "Unix Makefiles"
CXX_COMPILER: clang++
C_COMPILER: clang
CLEAN_BUILD: false
jobs:
build:
runs-on: macos-14
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache Protobuf Build
if: env.CLEAN_BUILD != 'true'
id: protobuf-cache
uses: actions/cache@v3
with:
path: build/third_party/protobuf
key: ${{ runner.os }}-protobuf-build-${{ hashFiles('third_party/protobuf/version.json') }}
- name: Check Protobuf Cache
if: env.CLEAN_BUILD != 'true'
run: |
echo "Protobuf cache hit: ${{ steps.protobuf-cache.outputs.cache-hit }}"
if [ "${{ steps.protobuf-cache.outputs.cache-hit }}" != 'true' ]; then
echo "Protobuf cache missed or expired, setting CLEAN_BUILD to true."
echo "CLEAN_BUILD=true" >> $GITHUB_ENV
fi
- name: Cache JUCE Build
if: env.CLEAN_BUILD != 'true'
id: juce-cache
uses: actions/cache@v3
with:
path: build/third_party/JUCE
key: ${{ runner.os }}-juce-build-${{ hashFiles('third_party/JUCE/CMakeLists.txt') }}
- name: Check JUCE Cache
if: env.CLEAN_BUILD != 'true'
run: |
echo "JUCE cache hit: ${{ steps.juce-cache.outputs.cache-hit }}"
if [ "${{ steps.juce-cache.outputs.cache-hit }}" != 'true' ]; then
echo "JUCE cache missed or expired, setting CLEAN_BUILD to true."
echo "CLEAN_BUILD=true" >> $GITHUB_ENV
fi
- name: Cache IAMF Build
if: env.CLEAN_BUILD != 'true'
id: iamf-cache
uses: actions/cache@v3
with:
path: build/third_party/iamf
key: ${{ runner.os }}-iamf-build-${{ hashFiles('third_party/iamf/CMakeLists.txt') }}
- name: Check IAMF Cache
if: env.CLEAN_BUILD != 'true'
run: |
echo "IAMF cache hit: ${{ steps.iamf-cache.outputs.cache-hit }}"
if [ "${{ steps.iamf-cache.outputs.cache-hit }}" != 'true' ]; then
echo "IAMF cache missed or expired, setting CLEAN_BUILD to true."
echo "CLEAN_BUILD=true" >> $GITHUB_ENV
fi
- name: Cache Libear Build
if: env.CLEAN_BUILD != 'true'
id: libear-cache
uses: actions/cache@v3
with:
path: build/third_party/libear
key: ${{ runner.os }}-libear-build-${{ hashFiles('third_party/libear/CMakeLists.txt') }}
- name: Check Libear Cache
if: env.CLEAN_BUILD != 'true'
run: |
echo "Libear cache hit: ${{ steps.libear-cache.outputs.cache-hit }}"
if [ "${{ steps.libear-cache.outputs.cache-hit }}" != 'true' ]; then
echo "Libear cache missed or expired, setting CLEAN_BUILD to true."
echo "CLEAN_BUILD=true" >> $GITHUB_ENV
fi
- name: Cache Main Build
if: env.CLEAN_BUILD != 'true'
id: main-build-cache
uses: actions/cache@v3
with:
path: build
key: ${{ runner.os }}-main-build-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'components/**/*.cpp', 'components/**/*.h') }}
- name: Check Main Build Cache
if: env.CLEAN_BUILD != 'true'
run: |
echo "Main build cache hit: ${{ steps.main-build-cache.outputs.cache-hit }}"
if [ "${{ steps.main-build-cache.outputs.cache-hit }}" != 'true' ]; then
echo "Main build cache missed or expired, setting CLEAN_BUILD to true."
echo "CLEAN_BUILD=true" >> $GITHUB_ENV
fi
- name: Check Clean Build
if: env.CLEAN_BUILD == 'true'
run: |
echo "CLEAN_BUILD is true, removing entire build directory."
if [ -d "build" ]; then rm -rf build; fi
- name: Cache FFmpeg Binaries
id: ffmpeg-cache
uses: actions/cache@v3
with:
path: external/FFmpeg/bin
key: ${{ runner.os }}-ffmpeg-6.0-${{ runner.arch }}
- name: Download FFmpeg and FFprobe Binaries
if: steps.ffmpeg-cache.outputs.cache-hit != 'true'
run: |
mkdir -p external/FFmpeg/bin
cd external/FFmpeg/bin
# Detect macOS architecture
ARCH=$(uname -m)
if [ "$ARCH" = "arm64" ]; then
PLATFORM="macos-arm64"
else
PLATFORM="macos-x64"
fi
echo "Detected platform: $PLATFORM"
# Download FFmpeg and FFprobe from GitHub releases
# Using latest stable release from ffmpeg-builds
FFMPEG_VERSION="8.0"
BASE_URL="https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2024-03-21-12-34-01"
echo "Downloading ffmpeg for $PLATFORM..."
curl -L "${BASE_URL}/ffmpeg-N-${FFMPEG_VERSION}-${PLATFORM}-gpl.zip" -o ffmpeg.zip
unzip -o ffmpeg.zip
# Move executables to bin directory
if [ -f "ffmpeg-N-${FFMPEG_VERSION}-${PLATFORM}-gpl/bin/ffmpeg" ]; then
mv ffmpeg-N-${FFMPEG_VERSION}-${PLATFORM}-gpl/bin/ffmpeg .
mv ffmpeg-N-${FFMPEG_VERSION}-${PLATFORM}-gpl/bin/ffprobe .
rm -rf ffmpeg-N-${FFMPEG_VERSION}-${PLATFORM}-gpl ffmpeg.zip
fi
# Verify binaries were downloaded
if [ ! -f "ffmpeg" ] || [ ! -f "ffprobe" ]; then
echo "Failed to download FFmpeg binaries"
exit 1
fi
# Make binaries executable
chmod +x ffmpeg ffprobe
# Verify they work
./ffmpeg -version | head -n 1
./ffprobe -version | head -n 1
cd ../../..
- name: Check Formatting
run: |
brew install clang-format
find common -iname '*.h' -o -iname '*.cpp' | xargs clang-format --style=file:.clang-format --dry-run -Werror -i
find rendererplugin -iname '*.h' -o -iname '*.cpp' | xargs clang-format --style=file:.clang-format --dry-run -Werror -i
find audioelementplugin -iname '*.h' -o -iname '*.cpp' | xargs clang-format --style=file:.clang-format --dry-run -Werror -i
- name: Setup CMake 3.30.x
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: "3.30.x"
- name: Verify CMake
run: |
cmake --version
which cmake
- name: Configure CMake
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -G "${{ env.GENERATOR }}" \
-D${{ env.TEST_TYPE }}=ON \
-DCMAKE_CXX_COMPILER=${{ env.CXX_COMPILER }} \
-DCMAKE_C_COMPILER=${{ env.C_COMPILER }} \
-DBUILD_TESTING=ON \
-DZMQ_BUILD_TESTS=OFF
- name: Build
run: cmake --build build --config ${{ env.BUILD_TYPE }} -- -j $(sysctl -n hw.logicalcpu)
- name: Test
working-directory: ${{ github.workspace }}/build
run: ctest -C ${{ env.BUILD_TYPE }}
# Dump CTest and Ecplisa logs if the previous step failed.
- name: Dump Test Logs
if: ${{ failure() }}
run: |
echo "//// CTest Logs ////" &&
cat /Users/runner/work/eclipsa/eclipsa/build/Testing/Temporary/LastTest.log &&
echo "//// Eclipsa Logs ////" &&
cat /tmp/Eclipsa_Audio_Plugin/log.txt