Skip to content

Work on CI builds

Work on CI builds #439

Workflow file for this run

#-------------------------------------------------------------------------------
# Workflow configuration
#-------------------------------------------------------------------------------
name: "Mobile CI builds"
on:
push:
pull_request:
workflow_dispatch:
#-------------------------------------------------------------------------------
# Define application name & version
#-------------------------------------------------------------------------------
env:
APP_NAME: "WatchFlower"
APP_VERSION: "6.0"
QT_VERSION: "6.7.3"
#-------------------------------------------------------------------------------
# Workflow jobs
#-------------------------------------------------------------------------------
jobs:
## Android build #############################################################
build-android:
name: "Android CI build"
runs-on: ubuntu-20.04
steps:
# Checkout repository (and submodules)
- name: Checkout repository (and submodules)
uses: actions/checkout@v4
with:
submodules: recursive
# Java environment (already installed in 'ubuntu-20.04')
- name: Setup Java environment
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
# Android environment (already installed in 'ubuntu-20.04')
#- name: Setup Android environment
# uses: android-actions/setup-android@v3
#- name: Install Android SDK / NDK / tools
# run: |
# sdkmanager "platforms;android-34"
# sdkmanager "ndk;26.3.11579264"
# sdkmanager "build-tools;34.0.0"
# Install Qt (desktop & Android)
- name: Install Qt (desktop & Android)
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
host: 'linux'
target: 'android'
arch: 'android_arm64_v8a'
modules: qtconnectivity qtcharts qtpositioning
extra: '--autodesktop'
# Setup env
- name: Setup env
run: |
echo "QT_HOST_PATH=/home/runner/work/${{env.APP_NAME}}/Qt/${{env.QT_VERSION}}/gcc_64" >> $GITHUB_ENV
echo "QT_TARGET_PATH=/home/runner/work/${{env.APP_NAME}}/Qt/${{env.QT_VERSION}}/android_arm64_v8a" >> $GITHUB_ENV
# Build application
- name: Build application
run: |
${{env.QT_TARGET_PATH}}/bin/qt-cmake --version
${{env.QT_TARGET_PATH}}/bin/qt-cmake -B build/ -G Ninja \
-DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH:PATH=${{env.QT_TARGET_PATH}} \
-DCMAKE_PREFIX_PATH:PATH=${{env.QT_TARGET_PATH}} \
-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT \
-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT \
-DANDROID_PLATFORM=android-23 \
-DANDROID_ABI="arm64-v8a" \
-DQT_HOST_PATH:PATH=${{env.QT_HOST_PATH}} \
-DQT_ANDROID_BUILD_ALL_ABIS=OFF \
-DQT_ANDROID_ABIS="arm64-v8a"
cmake --build build/ --config Release
## iOS build #################################################################
build-ios:
name: "iOS CI build"
runs-on: macos-13
steps:
# Checkout repository (and submodules)
- name: Checkout repository (and submodules)
uses: actions/checkout@v4
with:
submodules: recursive
# Install Qt (desktop & iOS)
- name: Install Qt (desktop & iOS)
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
host: 'mac'
target: 'ios'
modules: qtconnectivity qtcharts qtpositioning
extra: '--autodesktop'
# Install dependencies (from package manager)
#- name: Install dependencies (from package manager)
# run: |
# brew install cmake
# Setup env
- name: Setup env
run: |
echo "QT_HOST_PATH=/Users/runner/work/${{env.APP_NAME}}/Qt/${{env.QT_VERSION}}/macos" >> $GITHUB_ENV
echo "QT_TARGET_PATH=/Users/runner/work/${{env.APP_NAME}}/Qt/${{env.QT_VERSION}}/ios" >> $GITHUB_ENV
# Build application
- name: Build application
run: |
${{env.QT_TARGET_PATH}}/bin/qt-cmake --version
${{env.QT_TARGET_PATH}}/bin/qt-cmake -B build/ -G Xcode \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH:PATH=${{env.QT_TARGET_PATH}} \
-DCMAKE_PREFIX_PATH:PATH=${{env.QT_TARGET_PATH}} \
-DQT_HOST_PATH:PATH=${{env.QT_HOST_PATH}} \
-DENABLE_ARC=FALSE \
-DPLATFORM=OS64 \
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED="NO" \
cmake --build build/ --config Release