Tidy the examples in README.md a bit #114
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: Continuous Integration | |
on: [push] | |
jobs: | |
build: | |
runs-on: ${{matrix.configuration.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
qt-version: ['5.15.2', '6.5.3'] | |
configuration: | |
- id: windows-msvc | |
os: windows-2022 | |
- id: windows-mingw | |
os: windows-2022 | |
arch-qt5: win64_mingw81 | |
arch-qt6: win64_mingw | |
cmake-flags: [ | |
'-DCMAKE_C_COMPILER:FILEPATH=$env:IQTA_TOOLS/mingw1120_64/bin/gcc.exe', | |
'-DCMAKE_CXX_COMPILER:FILEPATH=$env:IQTA_TOOLS/mingw1120_64/bin/g++.exe', | |
'-DCMAKE_MAKE_PROGRAM:FILEPATH=$env:IQTA_TOOLS/Ninja/ninja.exe', | |
'-GNinja', | |
] | |
tools: 'tools_mingw90 tools_ninja' | |
- id: linux | |
os: ubuntu-22.04 | |
cmake-flags: [ | |
'-GNinja', | |
] | |
- id: android | |
os: ubuntu-22.04 | |
target: android | |
arch-qt5: android | |
arch-qt6: android_arm64_v8a | |
cmake-flags-qt5: [ | |
'-DANDROID_ABI:STRING=armeabi-v7a', | |
'-DANDROID_NDK:PATH=$ANDROID_NDK_ROOT', | |
'-DANDROID_SDK:PATH=$ANDROID_SDK_ROOT', | |
'-DANDROID_PLATFORM:STRING=android-21', | |
'-DANDROID_STL:STRING=c++_shared', | |
'-DANDROID_USE_LEGACY_TOOLCHAIN_FILE:BOOL=OFF', | |
'-DCMAKE_FIND_ROOT_PATH:PATH=$Qt5_DIR', | |
'-DCMAKE_PREFIX_PATH:STRING=$Qt5_DIR', | |
'-GNinja', '--toolchain', '$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake', | |
] | |
cmake-flags-qt6: [ | |
'-DANDROID_ABI:STRING=arm64-v8a', | |
'-DANDROID_PLATFORM:STRING=android-23', | |
'-DANDROID_SDK_ROOT:PATH=$ANDROID_SDK_ROOT', | |
'-DANDROID_NDK:PATH=$ANDROID_NDK_ROOT', | |
'-DANDROID_STL:STRING=c++_shared', | |
'-DANDROID_USE_LEGACY_TOOLCHAIN_FILE:BOOL=OFF', | |
'-DCMAKE_FIND_ROOT_PATH:PATH=$Qt6_DIR', | |
'-DCMAKE_PREFIX_PATH:STRING=$Qt6_DIR', | |
'-DQT_HOST_PATH=$Qt6_HOSTDIR', | |
'-DQT_NO_GLOBAL_APK_TARGET_PART_OF_ALL:BOOL=ON', | |
'-GNinja', '--toolchain', '$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake', | |
] | |
- id: macos | |
os: macos-12 | |
- id: ios | |
os: macos-12 | |
target: ios | |
cmake-flags: [ | |
'-DCMAKE_FIND_ROOT_PATH:PATH=$Qt5_DIR$Qt6_DIR', | |
'-DCMAKE_PREFIX_PATH:STRING=$Qt5_DIR$Qt6_DIR', | |
'-DCMAKE_SYSTEM_NAME:STRING=iOS', | |
'-DQT_HOST_PATH=$Qt6_HOSTDIR', | |
'-GXcode', | |
] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install host Qt for cross-compiling | |
id: install-host-qt | |
uses: jurplel/install-qt-action@v3 | |
if: (startsWith(matrix.qt-version, '6.') | |
&& (matrix.configuration.target || 'desktop') != 'desktop') | |
with: | |
version: ${{matrix.qt-version}} | |
target: 'desktop' | |
cache: true | |
- name: Store location of host Qt | |
if: steps.install-host-qt.outcome == 'success' | |
run: echo "Qt6_HOSTDIR=${Qt6_DIR}" >> $GITHUB_ENV | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{matrix.qt-version}} | |
target: ${{matrix.configuration.target || 'desktop'}} | |
arch: ${{startsWith(matrix.qt-version, '5.') | |
&& matrix.configuration.arch-qt5 | |
|| matrix.configuration.arch-qt6 | |
|| matrix.configuration.arch | |
|| ''}} | |
tools: ${{matrix.configuration.tools || ''}} | |
cache: true | |
- name: Install Ninja | |
if: matrix.configuration.os == 'ubuntu-22.04' | |
run: | | |
sudo apt-get install ninja-build | |
- name: Prepare | |
run: | | |
cmake -E make_directory ${{runner.workspace}}/build | |
- name: Configure | |
working-directory: ${{runner.workspace}}/build | |
run: cmake ${{github.workspace}} | |
-DCMAKE_BUILD_TYPE:STRING=Release | |
${{join(startsWith(matrix.qt-version, '5.') | |
&& matrix.configuration.cmake-flags-qt5 | |
|| matrix.configuration.cmake-flags-qt6 | |
|| matrix.configuration.cmake-flags, | |
' ')}} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: cmake-qt${{matrix.qt-version}}-${{matrix.configuration.id}} | |
path: | | |
${{runner.workspace}}/build/CMakeCache.txt | |
${{runner.workspace}}/build/CMakeFiles/CMakeOutput.log | |
- name: Build | |
working-directory: ${{runner.workspace}}/build | |
run: cmake --build . --config Release | |
- name: Test | |
if: (matrix.configuration.target || 'desktop') == 'desktop' | |
working-directory: ${{runner.workspace}}/build | |
run: | | |
ctest -C Release --verbose | |
- uses: actions/upload-artifact@v3 | |
if: (matrix.configuration.target || 'desktop') == 'desktop' | |
with: | |
name: ctest-qt${{matrix.qt-version}}-${{matrix.configuration.id}} | |
path: | | |
${{runner.workspace}}/build/Testing/Temporary/LastTest.log |