From f04dba363b0cf6e8acb840fe0de5b52f8af8b494 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 13 Jan 2022 19:17:09 +0100 Subject: [PATCH] Extend the CI to test the cpack generated package on Linux This builds all the examples against the package. --- .github/workflows/ci.yaml | 48 +++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 15 +----------- examples/CMakeLists.txt | 22 ++++++++++++++++++ 3 files changed, 71 insertions(+), 14 deletions(-) create mode 100644 examples/CMakeLists.txt diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ee2f7b67f..8d107ad45 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -243,6 +243,54 @@ jobs: - name: ctest working-directory: ${{ runner.workspace }}/cppbuild run: ctest --verbose + - name: cpack + working-directory: ${{ runner.workspace }}/cppbuild + run: cmake --build . --config Debug --target package + - name: "Create C++ packages artefact" + uses: actions/upload-artifact@v2 + with: + name: cpp_bin-${{ matrix.os }} + path: ${{ runner.workspace }}/cppbuild/SixtyFPS-cpp-* + + cpp_package_test: + needs: [cpp_cmake] + runs-on: ubuntu-20.04 + env: + DYLD_FRAMEWORK_PATH: /Users/runner/work/sixtyfps/Qt/6.2.1/clang_64/lib + QT_QPA_PLATFORM: offscreen + CARGO_INCREMENTAL: false + steps: + - uses: actions/checkout@v2 + - name: Install Linux Dependencies + run: sudo apt-get install libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev + - name: Cache Qt + id: cache-qt + uses: actions/cache@v2 + with: + path: ~/work/sixtyfps/Qt + key: ${{ runner.os }}-${{ github.job }}-cpp-qt + - name: Install Qt (Ubuntu) + uses: jurplel/install-qt-action@v2 + with: + version: 5.15.2 + cached: ${{ steps.cache-qt.outputs.cache-hit }} + - uses: actions/download-artifact@v2 + with: + name: cpp_bin-ubuntu-20.04 + path: cpp-package + - name: unpack package + run: | + mkdir package + tar xvf cpp-package/SixtyFPS-cpp-*.tar.gz -C package --strip-components=1 + echo "CMAKE_PREFIX_PATH=`pwd`/package" >> $GITHUB_ENV + - name: Build examples + uses: lukka/run-cmake@v3.4 + with: + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeListsTxtPath: examples/CMakeLists.txt + cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=Debug -DSIXTYFPS_FEATURE_INTERPRETER=1 -DSIXTYFPS_FEATURE_BACKEND_QT=1' + buildDirectory: ${{ runner.workspace }}/examples/build + buildWithCMakeArgs: '--config Debug' docs: uses: sixtyfpsui/sixtyfps/.github/workflows/build_docs.yaml@master diff --git a/CMakeLists.txt b/CMakeLists.txt index c4f79bec1..9c51a5bf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,20 +25,7 @@ if(SIXTYFPS_BUILD_EXAMPLES) if (WIN32) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) endif() - add_subdirectory(examples/printerdemo/cpp/) - if (SIXTYFPS_FEATURE_INTERPRETER) - add_subdirectory(examples/printerdemo/cpp_interpreted/) - endif() - add_subdirectory(examples/printerdemo_old/cpp/) - add_subdirectory(examples/todo/cpp/) - add_subdirectory(examples/gallery/) - add_subdirectory(examples/memory/) - if (SIXTYFPS_FEATURE_INTERPRETER AND SIXTYFPS_FEATURE_BACKEND_QT) - add_subdirectory(examples/qt_viewer/) - endif() - if (SIXTYFPS_FEATURE_INTERPRETER) - add_subdirectory(examples/iot-dashboard/) - endif() + add_subdirectory(examples) if(BUILD_TESTING) add_subdirectory(docs/tutorial/cpp/src/) endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 000000000..b11250f21 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright © SixtyFPS GmbH +# SPDX-License-Identifier: (GPL-3.0-only OR LicenseRef-SixtyFPS-commercial) + +if (NOT TARGET SixtyFPS::SixtyFPS) + find_package(SixtyFPS REQUIRED) + include(FetchContent) +endif() + +add_subdirectory(printerdemo/cpp/) +if (SIXTYFPS_FEATURE_INTERPRETER) + add_subdirectory(printerdemo/cpp_interpreted/) +endif() +add_subdirectory(printerdemo_old/cpp/) +add_subdirectory(todo/cpp/) +add_subdirectory(gallery/) +add_subdirectory(memory/) +if (SIXTYFPS_FEATURE_INTERPRETER AND SIXTYFPS_FEATURE_BACKEND_QT) + add_subdirectory(qt_viewer/) +endif() +if (SIXTYFPS_FEATURE_INTERPRETER) + add_subdirectory(iot-dashboard/) +endif()