Skip to content
Closed
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
18 changes: 15 additions & 3 deletions .github/workflows/model_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ env:
jobs:
validate-remote-models:
runs-on: ubuntu-22.04
timeout-minutes: 90
# Worst case is ~14 models x (timeout + retry delay + retry) plus a cold build
timeout-minutes: 150

steps:
- name: Install JUCE Linux dependencies
Expand All @@ -52,8 +53,19 @@ jobs:
with:
submodules: recursive

- name: ccache
uses: hendrikmuhs/ccache-action@main
with:
key: v1-model-validation

- name: Configure
run: cmake -B "$BUILD_DIR" -G Ninja -DCMAKE_BUILD_TYPE="$BUILD_TYPE" .
run: >
cmake -B "$BUILD_DIR" -G Ninja
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
-DHARP_BUILD_MODEL_VALIDATION=ON
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
.

- name: Build model validation runner
run: cmake --build "$BUILD_DIR" --config "$BUILD_TYPE" --target HARPRemoteModelTests --parallel 4
Expand All @@ -68,4 +80,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: remote-model-validation-report
path: artifacts/model_validation/remote
path: ${{ env.HARP_MODEL_VALIDATION_REPORT_DIR }}
84 changes: 55 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,42 +169,68 @@ if(WIN32)
)
endif()

include(CTest)
# Validate the bundled model registry at configure time so a bad edit fails the
# build instead of silently degrading the in-app model list.
file(READ "${CMAKE_SOURCE_DIR}/resources/models/model_registry.json" HARP_MODEL_REGISTRY_CONTENTS)
string(JSON HARP_MODEL_REGISTRY_MODEL_COUNT
ERROR_VARIABLE HARP_MODEL_REGISTRY_ERROR
LENGTH "${HARP_MODEL_REGISTRY_CONTENTS}" models)

if(HARP_MODEL_REGISTRY_ERROR)
message(FATAL_ERROR "resources/models/model_registry.json is invalid: ${HARP_MODEL_REGISTRY_ERROR}")
elseif(HARP_MODEL_REGISTRY_MODEL_COUNT LESS 1)
message(FATAL_ERROR "resources/models/model_registry.json contains no models.")
endif()

juce_add_console_app(HARPRemoteModelTests
PRODUCT_NAME "HARPRemoteModelTests"
)
# The validation runner performs live network calls against deployed models, so
# it is opt-in rather than part of the default build and test suite.
option(HARP_BUILD_MODEL_VALIDATION "Build the remote model validation runner (live-network tests)" OFF)

juce_generate_juce_header(HARPRemoteModelTests)
if(HARP_BUILD_MODEL_VALIDATION)
include(CTest)

target_sources(HARPRemoteModelTests
PRIVATE
tests/ModelValidationMain.cpp
${HARP_COMMON_SOURCES}
)
juce_add_console_app(HARPRemoteModelTests
PRODUCT_NAME "HARPRemoteModelTests"
)

target_include_directories(HARPRemoteModelTests
PRIVATE
"${CMAKE_SOURCE_DIR}/src"
)
juce_generate_juce_header(HARPRemoteModelTests)

target_compile_definitions(HARPRemoteModelTests
PRIVATE
JUCE_USE_CURL=1
JUCE_LOAD_CURL_SYMBOLS_LAZILY=1
HARP_SOURCE_DIR="${CMAKE_SOURCE_DIR}"
)
target_sources(HARPRemoteModelTests
PRIVATE
tests/ModelValidationMain.cpp
${HARP_COMMON_SOURCES}
)

target_link_libraries(HARPRemoteModelTests
PRIVATE
${HARP_JUCE_MODULES}
stability_controls
PUBLIC
${HARP_JUCE_FLAGS}
)
target_include_directories(HARPRemoteModelTests
PRIVATE
"${CMAKE_SOURCE_DIR}/src"
)

target_compile_definitions(HARPRemoteModelTests
PRIVATE
JUCE_WEB_BROWSER=0
JUCE_USE_CURL=1
JUCE_LOAD_CURL_SYMBOLS_LAZILY=1
JUCE_USE_OGGVORBIS=1
JUCE_USE_MP3AUDIOFORMAT=1
HARP_SOURCE_DIR="${CMAKE_SOURCE_DIR}"
)

target_link_libraries(HARPRemoteModelTests
PRIVATE
${HARP_JUCE_MODULES}
stability_controls
PUBLIC
${HARP_JUCE_FLAGS}
)

if(BUILD_TESTING)
add_test(NAME HARPRemoteModelTests COMMAND HARPRemoteModelTests)

if(BUILD_TESTING)
add_test(NAME HARPRemoteModelTests COMMAND HARPRemoteModelTests)
# The serial sweep can legitimately run for over an hour; ctest's default
# 1500s timeout would kill it mid-run before any report is written.
set_tests_properties(HARPRemoteModelTests PROPERTIES TIMEOUT 7200)
endif()
endif()

if(APPLE)
Expand Down
Binary file modified resources/media/test.wav
Binary file not shown.
Binary file removed resources/media/test_old.wav
Binary file not shown.
Loading
Loading