Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gallery App to CI #2744

Merged
merged 12 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 128 additions & 0 deletions .github/workflows/gallery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Gallery App
on:
push:
paths:
- 'app/qml/**'
- 'app/qmlV2/**'
- 'gallery/**'
- '.github/workflows/gallery.yml'

release:
types:
- published

concurrency:
group: ci-${{github.ref}}-gallery
cancel-in-progress: true

jobs:
gallery_build:
if: ( github.repository == 'MerginMaps/input' ) && (!contains(github.event.head_commit.message, 'Translate '))
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
runs-on: ${{ matrix.os }}
env:
QT_VERSION: '6.5.2'
GITHUB_TOKEN: ${{ secrets.INPUTAPP_BOT_GITHUB_TOKEN }}
CACHE_VERSION: 0
XC_VERSION: ${{ '14.2' }} # macos-only
VS_VERSION: "2019" # win-only
QT_ARCH: "win64_msvc2019_64" # win-only

steps:
- uses: actions/checkout@v3

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
setup-python: 'false'
modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools'
dir: ${{ github.workspace }}
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-v${{ env.CACHE_VERSION}}-${{ env.QT_VERSION }}-gallery

- name: Select latest Xcode (macos)
if: matrix.os == 'macos-latest'
run: "sudo xcode-select -s /Applications/Xcode_$XC_VERSION.app"

- uses: seanmiddleditch/gha-setup-ninja@master
if: matrix.os != 'windows-2019'

- name: Configure and Build Gallery App (macos & ubuntu)
if: matrix.os != 'windows-2019'
run: |
mkdir -p ${{ github.workspace }}/install-gallery
mkdir -p ${{ github.workspace }}/build-gallery
cd ${{ github.workspace }}/build-gallery

cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Qt/${QT_VERSION}/macos \
-DCMAKE_INSTALL_PREFIX:PATH=${{ github.workspace }}/install-gallery \
-GNinja \
-S ../gallery \
-B ./

ninja
ninja install

ls -la ${{ github.workspace }}/install-gallery

- name: Prepare vars (windows)
if: matrix.os == 'windows-2019'
id: vars
shell: bash
run: |
WORKSPACE_DIR=$(cygpath -m "${{ github.workspace }}")
echo "WORKSPACE_DIR=$WORKSPACE_DIR" >> $GITHUB_OUTPUT
echo "WORKSPACE_DIR: $WORKSPACE_DIR"

- name: Developer Command Prompt for Microsoft Visual C++ (windows)
if: matrix.os == 'windows-2019'
uses: ilammy/msvc-dev-cmd@v1
with:
vsversion: ${{ env.VS_VERSION }}

- name: Configure and Build Gallery App (windows)
if: matrix.os == 'windows-2019'
shell: cmd
run: |
mkdir install-gallery -ea 0
mkdir build-gallery -ea 0
cd build-gallery

cmake ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_PREFIX_PATH:PATH=${{ env.Qt6_Dir }} ^
-DCMAKE_INSTALL_PREFIX:PATH=${{ steps.vars.outputs.WORKSPACE_DIR }}/install-gallery ^
-G "NMake Makefiles" ^
-S ${{ steps.vars.outputs.WORKSPACE_DIR }}/gallery ^
-B .

nmake
nmake install

- name: Prepare artefacts (macos & ubuntu)
if: matrix.os != 'windows-2019'
run: |
cd ${{ github.workspace }}/install-gallery
ls -la .
tar -czf ${{ github.workspace }}/merginmaps-gallery-${{ matrix.os }}.tar.gz .

- name: Prepare artefacts (windows)
if: matrix.os == 'windows-2019'
shell: cmd
run: |
cd install-gallery
dir
tar -czf ${{ github.workspace }}/merginmaps-gallery-${{ matrix.os }}.tar.gz .

- name: Upload APK to Artifacts
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/merginmaps-gallery-${{ matrix.os }}.tar.gz
name: Mergin Maps Gallery ${{ matrix.os }}

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Other Checks:
[![Code Layout](https://github.com/MerginMaps/input/workflows/Code%20Layout/badge.svg)](https://github.com/MerginMaps/input/actions?query=workflow%3A%22Code+Layout%22)
[![Coverage Status](https://coveralls.io/repos/github/MerginMaps/input/badge.svg?branch=master)](https://coveralls.io/github/MerginMaps/input?branch=master)
[![Translations](https://github.com/MerginMaps/input/actions/workflows/i18n.yml/badge.svg)](https://github.com/MerginMaps/input/actions/workflows/i18n.yml)
[![Gallery App](https://github.com/MerginMaps/input/actions/workflows/gallery.yml/badge.svg)](https://github.com/MerginMaps/input/actions/workflows/gallery.yml)

Citation link:

Expand Down
32 changes: 22 additions & 10 deletions gallery/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
cmake_minimum_required(VERSION 3.16)

project(
gallery
MerginMapsGallery
VERSION 0.1
LANGUAGES CXX
)

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(QT6_VERSION
${QT_VERSION_DEFAULT}
6.5.2
CACHE STRING "QT6 version to use"
)
set(CMAKE_AUTORCC ON)
Expand All @@ -26,10 +26,11 @@ find_package(
REQUIRED
)

qt_standard_project_setup(REQUIRES 6.5)
qt_standard_project_setup()
qt_policy(SET QTP0001 NEW)

qt_add_executable(
appGallery
MerginMapsGallery
main.cpp
qml.qrc
fonts.qrc
Expand All @@ -40,14 +41,16 @@ qt_add_executable(
)

qt_add_qml_module(
appGallery
MerginMapsGallery
URI gallery
VERSION 1.0
QML_FILES qml/Main.qml
QML_FILES qml/Main.qml NO_GENERATE_QMLTYPES
)

qt_add_resources(fonts.qrc)

set_target_properties(
appGallery
MerginMapsGallery
PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING
Expand All @@ -56,13 +59,22 @@ set_target_properties(
WIN32_EXECUTABLE TRUE
)

target_link_libraries(appGallery PRIVATE Qt6::Quick)
target_link_libraries(MerginMapsGallery PRIVATE Qt6::Quick)

install(
TARGETS appGallery
TARGETS MerginMapsGallery
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

qt_add_resources(fonts.qrc)
qt_generate_deploy_qml_app_script(
TARGET
MerginMapsGallery
OUTPUT_SCRIPT
deploy_script
MACOS_BUNDLE_POST_BUILD
NO_UNSUPPORTED_PLATFORM_ERROR
DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM
)
install(SCRIPT ${deploy_script})
2 changes: 1 addition & 1 deletion gallery/helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* *
***************************************************************************/

#include "Helper.h"
#include "helper.h"
#include <QGuiApplication>
#include <QScreen>
#include <QFontDatabase>
Expand Down
Loading