Set QT_HOST_PATH for parallel desktop installations #113
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: CI-android | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-22.04 | |
- windows-2022 | |
- macos-15 | |
qt: | |
- version: "5.15.2" | |
ndk-version: r21e | |
modules: | |
example-archives: qtbase qtsensors | |
example-modules: | |
- version: "6.3.2" | |
ndk-version: r21e | |
modules: qtsensors | |
example-archives: qtbase | |
example-modules: qtsensors | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
cache-dependency-path: action/ | |
- run: | | |
cd action | |
npm ci || npm install | |
shell: bash | |
- run: | | |
cd action | |
npm run build | |
- name: Install Qt | |
uses: ./ | |
with: | |
target: android | |
modules: ${{ matrix.qt.modules }} | |
version: ${{ matrix.qt.version }} | |
examples: true | |
example-archives: ${{ matrix.qt.example-archives }} | |
example-modules: ${{ matrix.qt.example-modules }} | |
- name: Test QT_HOST_PATH | |
if: ${{ startsWith(matrix.qt.version, '6.') }} | |
shell: pwsh | |
run: | | |
$qmakeHostPrefix = [string](Resolve-Path -Path (qmake -query QT_HOST_PREFIX)) | |
if ($env:QT_HOST_PATH -ne $qmakeHostPrefix) { | |
throw "QT_HOST_PATH should match qmake's QT_HOST_PREFIX." | |
} | |
if ($env:QT_HOST_PATH -eq $env:QT_ROOT_DIR) { | |
throw "QT_HOST_PATH and QT_ROOT_DIR should be different." | |
} | |
if ((Split-Path -Path $env:QT_HOST_PATH -Parent) -ne (Split-Path -Path $env:QT_ROOT_DIR -Parent)) { | |
throw "QT_HOST_PATH and QT_ROOT_DIR should have the same parent directory." | |
} | |
Write-Host "All tests passed!" | |
- name: Install Android NDK | |
shell: bash | |
# Links to NDK are at https://github.com/android/ndk/wiki/Unsupported-Downloads | |
run: | | |
if [[ "${RUNNER_OS}" == "Linux" ]]; then | |
export TARGET_ARCH="linux" | |
elif [[ "${RUNNER_OS}" == "Windows" ]]; then | |
export TARGET_ARCH="windows" | |
else | |
export TARGET_ARCH="darwin" | |
fi | |
export NDK_VER_NUM=$(echo ${{ matrix.qt.ndk-version }} | sed -e 's/r(\d+).*/$1/g') | |
# If it's less than 23, append -x86_64 | |
if (( "${NDK_VER_NUM}" < 23 )); then | |
export TARGET_ARCH="${TARGET_ARCH}-x86_64" | |
fi; | |
curl -O "https://dl.google.com/android/repository/android-ndk-${{ matrix.qt.ndk-version }}-${TARGET_ARCH}.zip" | |
unzip "android-ndk-${{ matrix.qt.ndk-version }}-${TARGET_ARCH}.zip" | |
- name: Build test project | |
env: | |
QT_VERSION: ${{ matrix.qt.version }} | |
run: | | |
export ANDROID_NDK_ROOT=$(pwd)/android-ndk-${{ matrix.qt.ndk-version }} | |
cd ../Qt/Examples/Qt-${{ matrix.qt.version }}/sensors/accelbubble | |
qmake || qmake.bat | |
make | |
shell: bash |