From 3f706a879e7d623fb4c0e9fe613c7d87ad1cb9d7 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Tue, 16 Dec 2025 11:30:05 -0500 Subject: [PATCH] Github Workflow: Upload build artifacts. --- .github/workflows/presubmit.yml | 24 +++++++++++-- CMakeLists.txt | 12 +++++++ ui/CMakeLists.txt | 62 +++++++++++++++++++++++---------- 3 files changed, 77 insertions(+), 21 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 090be9d85..6cd9d6fcd 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -64,6 +64,14 @@ jobs: - name: Build Dive host tools with VS 2022 run: | cmake --build build --config Release + - name: Produce install artifacts + run: | + cmake --install build --prefix build/install_artifact --config Release + - name: Upload test output + uses: actions/upload-artifact@v6 + with: + name: install_artifact_windows + path: build/install_artifact - name: Run tests run: | ctest --output-on-failure -C Release --test-dir build @@ -280,7 +288,12 @@ jobs: cat build/.ninja_log - name: Produce install artifacts run: | - cmake --install build --prefix install --config Release + cmake --install build --prefix build/install_artifact --config Release + - name: Upload test output + uses: actions/upload-artifact@v6 + with: + name: install_artifact_linux + path: build/install_artifact - name: Start Xvfb run: | Xvfb :99 -screen 0 1024x768x24 & @@ -403,7 +416,14 @@ jobs: cat build/.ninja_log - name: Produce install artifacts run: | - cmake --install build --prefix install --config Release + cmake --install build --prefix build/install_artifact --config Release + - name: Upload test output + uses: actions/upload-artifact@v6 + with: + name: install_artifact_macos + path: | + build/ui/dive.app + build/install_artifact - name: Run tests run: | ctest --output-on-failure -C Release --test-dir build diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a0194db7..619516dc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,18 @@ option( ON ) +set(DIVE_ANDROID_PREBUILT + "${CMAKE_SOURCE_DIR}/install" + CACHE STRING + "Prebuilt Dive Android binaries" +) + +set(DIVE_PROFILING_PLUGIN_PATH + "${CMAKE_SOURCE_DIR}/install/dive_profiling_plugin" + CACHE STRING + "Prebuilt Dive Profiling Plugin" +) + option(DIVE_BUILD_WITH_SANITIZER "Build Dive with sanitizers" OFF) # Placeholder value for DESTINATION to override cmake default. diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index c9db43a73..a95fff153 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -322,11 +322,54 @@ if(MSVC) endif() if(APPLE) + set(MACOS_RESOURCE_FILES "") + + if(EXISTS "${DIVE_ANDROID_PREBUILT}") + list( + APPEND MACOS_RESOURCE_FILES + "${DIVE_ANDROID_PREBUILT}/gfxr-replay.apk" + "${DIVE_ANDROID_PREBUILT}/gfxrecon.py" + "${DIVE_ANDROID_PREBUILT}/libVkLayer_dive.so" + "${DIVE_ANDROID_PREBUILT}/libVkLayer_khronos_validation.so" + "${DIVE_ANDROID_PREBUILT}/libXrApiLayer_dive.so" + "${DIVE_ANDROID_PREBUILT}/XrApiLayer_dive.json" + "${DIVE_ANDROID_PREBUILT}/libVkLayer_rt_dive.so" + "${DIVE_ANDROID_PREBUILT}/libwrap.so" + "${DIVE_ANDROID_PREBUILT}/libVkLayer_gfxreconstruct.so" + ) + endif() + set_target_properties( ${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE TRUE MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in" + RESOURCE "${MACOS_RESOURCE_FILES}" + ) + + if(EXISTS "${DIVE_PROFILING_PLUGIN_PATH}") + add_custom_command( + TARGET ${PROJECT_NAME} + POST_BUILD + COMMAND + cp -r "${DIVE_PROFILING_PLUGIN_PATH}" + "$/Contents/Resources/dive_profiling_plugin" + ) + endif() + + # Install Qt Dependencies + add_custom_command( + TARGET ${PROJECT_NAME} + POST_BUILD + COMMAND macdeployqt "$" + ) + # Add dive.app/MacOS/dive_client_cli + add_custom_command( + TARGET ${PROJECT_NAME} + POST_BUILD + COMMAND + cp "$" + "$/Contents/MacOS" ) endif() @@ -336,27 +379,8 @@ if(APPLE) install( CODE " - message(STATUS \"Running macdeployqt...\") - execute_process(COMMAND \"macdeployqt\" \"${CMAKE_INSTALL_PREFIX}/dive.app\") message(STATUS \"Creating install directory in app bundle\") execute_process(COMMAND \"${CMAKE_COMMAND}\" -E make_directory \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\") - message(STATUS \"Copying Android files to app bundle\") - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/gfxr-replay.apk\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\") - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/gfxrecon.py\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\") - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/libVkLayer_dive.so\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\") - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/libVkLayer_khronos_validation.so\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\") - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/libXrApiLayer_dive.so\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\") - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/XrApiLayer_dive.json\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\") - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/libVkLayer_rt_dive.so\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\") - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/libwrap.so\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\") - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/libVkLayer_gfxreconstruct.so\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/\") - message(STATUS \"Copying dive_client_cli to app bundle\") - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/dive_client_cli\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/MacOS/\") - - if(IS_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/dive_profiling_plugin\") - message(STATUS \"Copying dive_profiling_plugin to app bundle\") - execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy_directory \"${CMAKE_INSTALL_PREFIX}/dive_profiling_plugin/\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/Resources/dive_profiling_plugin\") - endif() if(EXISTS \"${CMAKE_INSTALL_PREFIX}/dive_compositor_capture.sh\") message(STATUS \"Copying dive_compositor_capture.sh to app bundle\") execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy \"${CMAKE_INSTALL_PREFIX}/dive_compositor_capture.sh\" \"${CMAKE_INSTALL_PREFIX}/dive.app/Contents/MacOS/\")