Skip to content

Add debug builds (and more output), fix port not being cleared before first getting settings #224

Add debug builds (and more output), fix port not being cleared before first getting settings

Add debug builds (and more output), fix port not being cleared before first getting settings #224

name: CMake - Windows & Linux
on:
push:
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2019]
qt_version: [5.15.2, 6.7.3, 6.8.3]
build_type: [Debug, Release]
include:
- os: windows-2019
c_compiler: cl
cpp_compiler: cl
file: build
qt_arch: windows
qt_version: 6.8.3
qt6_modules: "qtserialport"
pretty: "Windows Artifact"
- os: ubuntu-22.04
c_compiler: clang
cpp_compiler: clang++
file: OpenFIRE_App-x86_64.AppImage
qt_arch: linux
qt_version: 5.15.2
qt6_modules: "qtserialport qtwaylandcompositor"
sys_arch: x86_64
install_prefix: -DCMAKE_INSTALL_PREFIX=/usr
pretty: "Linux x86 AppImage"
- os: ubuntu-22.04
c_compiler: clang
cpp_compiler: clang++
file: OpenFIRE_App-x86_64.AppImage
qt_arch: linux
qt_version: 6.8.3
qt6_modules: "qtserialport qtwaylandcompositor"
sys_arch: x86_64
install_prefix: -DCMAKE_INSTALL_PREFIX=/usr
pretty: "Linux x86 AppImage"
- os: ubuntu-22.04-arm
c_compiler: clang
cpp_compiler: clang++
file: OpenFIRE_App-aarch64.AppImage
qt_arch: linux_arm64
qt_version: 6.7.3
qt6_modules: "qtserialport qtwaylandcompositor"
sys_arch: aarch64
install_prefix: -DCMAKE_INSTALL_PREFIX=/usr
pretty: "Linux ARM AppImage"
exclude:
- os: windows-2019
qt_version: 5.15.2
- os: windows-2019
qt_version: 6.7.3
- os: ubuntu-22.04
qt_version: 6.7.3
- os: ubuntu-22.04-arm
qt_version: 5.15.2
- os: ubuntu-22.04-arm
qt_version: 6.8.3
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Get short SHA
id: get-short-sha
run: echo "id=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
# TODO: using install-qt-action fork until https://github.com/jurplel/install-qt-action/issues/248 is resolved & merged
- name: Install Qt(5)
if: ${{ matrix.qt_version == '5.15.2' }}
uses: jdpurcell/install-qt-action@v5
with:
version: '${{ matrix.qt_version }}'
archives: 'qtbase qtwayland qttranslations qttools qtsvg qtserialport icu'
- name: Install Qt(6)
if: ${{ matrix.qt_version != '5.15.2' }}
uses: jdpurcell/install-qt-action@v5
with:
version: '${{ matrix.qt_version }}'
host: '${{ matrix.qt_arch }}'
modules: '${{ matrix.qt6_modules }}'
archives: 'qtbase qtwayland qttranslations qttools qtsvg icu'
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DOFAPP_GITHASH=${{steps.get-short-sha.outputs.id}}
${{ matrix.install_prefix }}
-S ${{ github.workspace }}
- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Install linuxdeploy
if: ${{ matrix.os != 'windows-2019' }}
uses: pcolby/install-linuxdeploy@v1
with:
plugins: qt appimage
- name: Setup AppImage
if: ${{ matrix.os != 'windows-2019' }}
env:
EXTRA_PLATFORM_PLUGINS: libqwayland-generic.so
EXTRA_QT_MODULES: waylandcompositor
run: |
make install DESTDIR=AppDir
install -Dm755 "${{ github.workspace }}/img/ico/openfire.svg" "AppDir/usr/share/icons/hicolor/scalable/apps/org.TeamOpenFIRE.OpenFIREapp.svg"
"${{ runner.temp }}/linuxdeploy/linuxdeploy-${{ matrix.sys_arch }}.AppImage" --plugin=qt --output appimage --appdir AppDir --desktop-file "${{ github.workspace }}/org.TeamOpenFIRE.OpenFIREapp.desktop"
cp ${{ matrix.file }} ${{ github.workspace }}
working-directory: ${{ steps.strings.outputs.build-output-dir }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: OpenFIREapp-${{ matrix.pretty }}-Qt${{ matrix.qt_version }}-${{ matrix.build_type }} # optional, default is artifact
# A file, directory or wildcard pattern that describes what to upload
path: ${{ matrix.file }}
- name: Download a Build Artifact
uses: actions/download-artifact@v4