Skip to content

More robust buffer checks and wait before starting commit sequence to make sure board is ready #169

More robust buffer checks and wait before starting commit sequence to make sure board is ready

More robust buffer checks and wait before starting commit sequence to make sure board is ready #169

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, windows-2019]
build_type: [Release]
c_compiler: [clang, cl]
qt_version: [5.15.2, 6.8.2]
include:
- os: windows-2019
c_compiler: cl
cpp_compiler: cl
file: build
pretty: "Windows Artifact"
- os: ubuntu-22.04
c_compiler: clang
cpp_compiler: clang++
file: OpenFIRE_App-x86_64.AppImage
install_prefix: -DCMAKE_INSTALL_PREFIX=/usr
pretty: "Linux AppImage"
exclude:
- os: windows-2019
c_compiler: clang
- os: ubuntu-22.04
c_compiler: cl
qt_version: 6.8.2
- os: ubuntu-22.04
c_compiler: cl
qt_version: 5.15.2
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
- name: Install Qt(5)
if: ${{ matrix.qt_version == '5.15.2' }}
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*'
version: '${{ matrix.qt_version }}'
archives: 'qtbase qttranslations qttools qtsvg qtserialport icu'
- name: Install Qt(6)
if: ${{ matrix.qt_version == '6.8.2' }}
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*'
version: '${{ matrix.qt_version }}'
modules: 'qtserialport'
archives: 'qtbase qttranslations qttools qtsvg icu'
- name: Configure CMake (for Qt5)
if: ${{ matrix.qt_version == '5.15.2' }}
# 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}}
-DOFAPP_QT_VERSIONS=Qt5
${{ matrix.install_prefix }}
-S ${{ github.workspace }}
- name: Configure CMake (for Qt6)
if: ${{ matrix.qt_version == '6.8.2' }}
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 == 'ubuntu-22.04' }}
uses: miurahr/install-linuxdeploy-action@v1
with:
plugins: qt appimage
- name: Setup AppImage
if: ${{ matrix.os == 'ubuntu-22.04' }}
# thanks linuxdeploy for not preinstalling your dependencies :<
run: |
sudo apt install -y appstream libfuse2
make install DESTDIR=AppDir
install -Dm755 "${{ github.workspace }}/org.TeamOpenFIRE.OpenFIREapp.desktop" "AppDir/usr/share/applications/org.TeamOpenFIRE.OpenFIREapp.desktop"
install -Dm755 "${{ github.workspace }}/img/ico/openfire.svg" "AppDir/usr/share/icons/hicolor/scalable/apps/org.TeamOpenFIRE.OpenFIREapp.svg"
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --appdir AppDir
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 }} # 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