add QtTest example #29
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Examples | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ${{ matrix.base.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
base: [ | |
# Qt v5.15.2 | |
{name: 'qt-5.15.2 ubuntu', os: ubuntu-latest, build_type: Debug,qt_version: [5, 15, 2], shared_libs: 'OFF', tests: 'OFF'}, | |
{name: 'qt-5.15.2 windows', os: windows-latest, build_type: Debug, qt_version: [5, 15, 2], shared_libs: 'OFF', tests: 'OFF', cmake_flags: '"-DAnyRPC_ROOT=C:/Program Files (x86)/AnyRPC" "-DGTest_ROOT=C:/Program Files (x86)/googletest-distribution"'}, | |
{name: 'qt-5.15.2 macos', os: macos-latest, build_type: Debug, qt_version: [5, 15, 2], shared_libs: 'OFF', tests: 'OFF'}, | |
# Qt v6.2.3 | |
{name: 'qt-6.2.3 ubuntu', os: ubuntu-latest, build_type: Debug, qt_version: [6, 2, 3], shared_libs: 'OFF', tests: 'OFF'}, | |
{name: 'qt-6.2.3 windows', os: windows-latest, build_type: Debug, qt_version: [6, 2, 3], shared_libs: 'OFF', tests: 'OFF', cmake_flags: '"-DAnyRPC_ROOT=C:/Program Files (x86)/AnyRPC" "-DGTest_ROOT=C:/Program Files (x86)/googletest-distribution"'}, | |
# Qt6 on GitHub Actions MacOS is currently bugged: https://bugreports.qt.io/browse/QTIFW-1592 | |
# {name: 'qt-6.2.3 macos', os: macos-latest, build_type: Debug, qt_version: [6, 2, 3], shared_libs: 'OFF', tests: 'OFF'}, | |
] | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ join(matrix.base.qt_version, '.') }} | |
cache: true | |
- name: Install dependencies | |
env: | |
CI_BUILD_TYPE: ${{ matrix.base.build_type }} | |
SHARED_LIBS: ${{ matrix.base.shared_libs }} | |
run: sh ./ci/install-deps.sh | |
- name: "Configure" | |
run: | | |
mkdir build | |
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.base.build_type }} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSPIX_BUILD_TESTS=${{ matrix.base.tests }} -DSPIX_BUILD_EXAMPLES=ON ${{ matrix.base.cmake_flags }} -DBUILD_SHARED_LIBS=${{ matrix.base.shared_libs }} -DSPIX_QT_MAJOR=${{ matrix.base.qt_version[0] }} . | |
- name: "Build" | |
run: cmake --build build --config ${{ matrix.base.build_type }} | |
- name: "Test GTest Examples (*nix)" | |
if: ${{ !contains(matrix.base.os, 'windows') }} | |
run: | | |
build/examples/GTest/SpixGTestExample -platform minimal | |
build/examples/RepeaterLoader/SpixRepeaterLoaderExampleGTest -platform minimal | |
- name: "Test GTest Examples (win)" | |
if: ${{ contains(matrix.base.os, 'windows') }} | |
run: | | |
.\build\examples\GTest\${{ matrix.base.build_type }}\SpixGTestExample.exe -platform minimal | |
.\build\examples\RepeaterLoader\${{ matrix.base.build_type }}\SpixRepeaterLoaderExampleGTest.exe -platform minimal |