324 lines
11 KiB
YAML
324 lines
11 KiB
YAML
name: CMake Build Matrix
|
|
|
|
# Directories
|
|
# - $GITHUB_WORKSPACE/qskinny_source : Checkout directory for qskinny sources
|
|
# - $GITHUB_WORKSPACE/qskinny_build : Build directory for QSkinny CMake
|
|
# - $GITHUB_WORKSPACE/qskinny_install : Install directory for QSkinny package
|
|
# - $GITHUB_WORKSPACE/qskinny_build_test : Build directory for QSkinny CMake integration test
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
build:
|
|
name: ${{ matrix.config.name }}
|
|
runs-on: ${{ matrix.config.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
config:
|
|
- {
|
|
name: "Windows Latest MSVC Qt5",
|
|
os: windows-latest,
|
|
artifact: "windows_msvc.7z",
|
|
build_type: "Release",
|
|
cc: "cl",
|
|
cxx: "cl",
|
|
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
|
|
archiver: "7z a",
|
|
generators: "Visual Studio 17 2022",
|
|
cmake:
|
|
{
|
|
qtversion: "5.15.2",
|
|
qtdirkey: "Qt5_DIR",
|
|
qtdirvalue: "../Qt/5.15.2/msvc2019_64/lib/cmake/Qt5",
|
|
qtprefixpath: "../Qt/5.15.2/msvc2019_64",
|
|
},
|
|
screenshot_filename: "windows-latest-msvc-qt-5-15-2.jpg",
|
|
}
|
|
- {
|
|
name: "Windows Latest MSVC Qt6",
|
|
os: windows-latest,
|
|
artifact: "windows_msvc.7z",
|
|
build_type: "Release",
|
|
cc: "cl",
|
|
cxx: "cl",
|
|
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
|
|
archiver: "7z a",
|
|
generators: "Visual Studio 17 2022",
|
|
cmake:
|
|
{
|
|
qtversion: "6.5.0",
|
|
qtdirkey: "Qt6_DIR",
|
|
qtdirvalue: "../Qt/6.5.0/msvc2019_64/lib/cmake/Qt6",
|
|
qtprefixpath: "../Qt/6.5.0/msvc2019_64",
|
|
},
|
|
screenshot_filename: "windows-latest-msvc-qt-6.5.0.jpg",
|
|
}
|
|
- {
|
|
name: "Ubuntu Latest GCC Qt5",
|
|
os: ubuntu-latest,
|
|
artifact: "ubuntu_gcc.7z",
|
|
build_type: "Release",
|
|
cc: "gcc",
|
|
cxx: "g++",
|
|
archiver: "7z a",
|
|
# generators: "Ninja Multi-Config",
|
|
generators: "Ninja",
|
|
env: { DISPLAY: ":1" },
|
|
cmake:
|
|
{
|
|
qtversion: "5.15.2",
|
|
qtdirkey: "Qt5_DIR",
|
|
qtdirvalue: "../Qt/5.15.2/gcc_64/lib/cmake/Qt5",
|
|
qtprefixpath: "../Qt/5.15.2/gcc_64",
|
|
},
|
|
screenshot_filename: "ubuntu-latest-gcc-qt-5-15-2.jpg",
|
|
}
|
|
- {
|
|
name: "Ubuntu Latest GCC Qt6",
|
|
os: ubuntu-latest,
|
|
artifact: "ubuntu_gcc.7z",
|
|
build_type: "Release",
|
|
cc: "gcc",
|
|
cxx: "g++",
|
|
archiver: "7z a",
|
|
generators: "Ninja",
|
|
env: { DISPLAY: ":1" },
|
|
cmake:
|
|
{
|
|
qtversion: "6.5.0",
|
|
qtdirkey: "Qt6_DIR",
|
|
qtdirvalue: "../Qt/6.5.0/gcc_64/lib/cmake/Qt6",
|
|
qtprefixpath: "../Qt/6.5.0/gcc_64",
|
|
},
|
|
screenshot_filename: "ubuntu-latest-gcc-qt-6.5.0.jpg",
|
|
}
|
|
- {
|
|
name: "macOS Latest Clang Qt5",
|
|
os: macos-13,
|
|
artifact: "macos_clang.7z",
|
|
build_type: "Release",
|
|
cc: "clang",
|
|
cxx: "clang++",
|
|
archiver: "7za a",
|
|
generators: "Ninja",
|
|
cmake:
|
|
{
|
|
qtversion: "5.15.2",
|
|
qtdirkey: "Qt5_DIR",
|
|
qtdirvalue: "../Qt/5.15.2/clang_64/lib/cmake/Qt5",
|
|
qtprefixpath: "../Qt/5.15.2/clang_64",
|
|
},
|
|
screenshot_filename: "macos-latest-clang-qt-5-15-2.jpg",
|
|
}
|
|
- {
|
|
name: "macOS Latest Clang Qt6",
|
|
os: macos-latest,
|
|
artifact: "macos_clang.7z",
|
|
build_type: "Release",
|
|
cc: "clang",
|
|
cxx: "clang++",
|
|
archiver: "7za a",
|
|
generators: "Ninja",
|
|
cmake:
|
|
{
|
|
qtversion: "6.5.0",
|
|
qtdirkey: "Qt6_DIR",
|
|
qtdirvalue: "../Qt/6.5.0/clang_64/lib/cmake/Qt6",
|
|
qtprefixpath: "../Qt/6.5.0/clang_64",
|
|
},
|
|
screenshot_filename: "macos-latest-clang-qt-6.5.0.jpg",
|
|
}
|
|
|
|
steps:
|
|
- name: Git Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
path: qskinny_source
|
|
|
|
- name: Print env
|
|
run: |
|
|
echo github.event.action: ${{ github.event.action }}
|
|
echo github.event_name: ${{ github.event_name }}
|
|
|
|
- name: Install dependencies on windows
|
|
if: startsWith(matrix.config.os, 'windows')
|
|
run: |
|
|
choco install ninja
|
|
choco install cmake --version=3.16.3
|
|
ninja --version
|
|
cmake --version
|
|
|
|
- name: Install dependencies on ubuntu
|
|
if: startsWith(matrix.config.name, 'Ubuntu Latest GCC')
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install ninja-build cmake
|
|
ninja --version
|
|
cmake --version
|
|
gcc --version
|
|
|
|
- name: Install dependencies on macos
|
|
if: startsWith(matrix.config.os, 'macos')
|
|
run: |
|
|
find /opt/homebrew/ -name EXTERNALLY-MANAGED|xargs rm
|
|
brew install cmake ninja
|
|
ninja --version
|
|
cmake --version
|
|
|
|
- name: Install needed xkbcommon symlink
|
|
if: startsWith(matrix.config.name, 'Ubuntu')
|
|
run: |
|
|
sudo apt-get install libxkbcommon-dev -y
|
|
sudo apt-get install libxkbcommon-x11-0 -y
|
|
sudo apt-get install libxcb-cursor-dev -y
|
|
sudo apt-get install x11-xserver-utils -y
|
|
|
|
- name: Install hunspell for Ubuntu
|
|
if: false && startsWith(matrix.config.name, 'Ubuntu')
|
|
run: |
|
|
sudo apt-get install -y libhunspell-dev
|
|
|
|
- name: Install pinyin for Ubuntu
|
|
if: false && startsWith(matrix.config.name, 'Ubuntu')
|
|
run: |
|
|
sudo apt-get install -y libimepinyin-dev
|
|
|
|
- name: Install imagemagick for Ubuntu
|
|
if: startsWith(matrix.config.name, 'Ubuntu')
|
|
run: |
|
|
sudo apt-get install -y imagemagick
|
|
|
|
- name: Install Qt5
|
|
if: endsWith(matrix.config.name, 'Qt5')
|
|
uses: jurplel/install-qt-action@v4
|
|
with:
|
|
version: "5.15.2"
|
|
target: "desktop"
|
|
install-deps: "true"
|
|
modules: "qtwebengine"
|
|
cached: ${{ steps.cache-qt-5-15.outputs.cache-hit }}
|
|
tools: ""
|
|
set-env: "true"
|
|
tools-only: "false"
|
|
|
|
- name: Install Qt6
|
|
if: endsWith(matrix.config.name, 'Qt6')
|
|
uses: jurplel/install-qt-action@v4
|
|
with:
|
|
version: "6.5.0"
|
|
target: "desktop"
|
|
install-deps: "true"
|
|
modules: "qtwebengine qtshadertools"
|
|
cached: ${{ steps.cache-qt-6-2.outputs.cache-hit }}
|
|
tools: ""
|
|
set-env: "true"
|
|
tools-only: "false"
|
|
|
|
- name: Configure ( QSkinny )
|
|
shell: bash
|
|
run: |
|
|
mkdir qskinny_build
|
|
mkdir qskinny_install
|
|
cmake \
|
|
-S qskinny_source \
|
|
-B qskinny_build \
|
|
-G "${{ matrix.config.generators }}" \
|
|
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
|
|
-DCMAKE_INSTALL_PREFIX:PATH=qskinny_install \
|
|
-DCMAKE_PREFIX_PATH:PATH="${{ matrix.config.cmake.qtprefixpath }}" \
|
|
-D${{ matrix.config.cmake.qtdirkey }}:PATH="${{ matrix.config.cmake.qtdirvalue }}"
|
|
|
|
- name: Build ( QSkinny )
|
|
shell: bash
|
|
run: cmake --build qskinny_build --config ${{ matrix.config.build_type }}
|
|
|
|
#- name: Tests
|
|
# shell: bash
|
|
# run: ctest -j14 -C Release -T test --output-on-failure
|
|
|
|
- name: Install ( QSkinny ) Strip
|
|
shell: bash
|
|
run: cmake --install qskinny_build --prefix qskinny_install --strip --config ${{ matrix.config.build_type }}
|
|
|
|
- name: Smoke test ( QSkinny ) on MacOS
|
|
if: startsWith(matrix.config.name, 'macOS')
|
|
env:
|
|
QT_DEBUG_PLUGINS: "1"
|
|
run: |
|
|
echo "starting iotdashboard"
|
|
DYLD_LIBRARY_PATH=./qskinny_install/lib:./qskinny_install/plugins/skins ./qskinny_build/examples/bin/iotdashboard.app/Contents/MacOS/iotdashboard -qwindowgeometry 1024x600+75+100 --screenshot ${{ matrix.config.screenshot_filename }} &
|
|
sleep 10
|
|
|
|
# TODO remove 'qskinny_build\skins\material3\Release' when skin install is fixed
|
|
- name: Smoke Test ( QSkinny ) on Windows
|
|
if: startsWith(matrix.config.name, 'Windows')
|
|
env:
|
|
QT_DEBUG_PLUGINS: "1"
|
|
run: |
|
|
$env:Path += ";./qskinny_install/bin;./qskinny_install/lib;./qskinny_install/plugins/skins;./qskinny_build/skins/material3/Release;./qskinny_build/skins/windows/Release;./qskinny_build/skins/squiek/Release"
|
|
echo "starting iotdashboard"
|
|
Start-Process qskinny_build\examples\bin\Release\iotdashboard.exe -ArgumentList "-qwindowgeometry 1024x600+0+0 --screenshot ${{ matrix.config.screenshot_filename }}"
|
|
Start-Sleep -Seconds 10
|
|
|
|
- name: Smoke test ( QSkinny ) on Ubuntu
|
|
if: startsWith(matrix.config.name, 'Ubuntu')
|
|
env:
|
|
DISPLAY: ":1"
|
|
QT_DEBUG_PLUGINS: "1"
|
|
run: |
|
|
echo starting Xvfb
|
|
Xvfb :1 &
|
|
sleep 10
|
|
echo starting iotdashboard
|
|
./qskinny_build/examples/bin/iotdashboard --screenshot ${{ matrix.config.screenshot_filename }} &
|
|
sleep 10
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.config.screenshot_filename }}
|
|
path: ${{ matrix.config.screenshot_filename }}
|
|
|
|
#- uses: OrbitalOwen/desktop-screenshot-action@0.1
|
|
# with:
|
|
# file-name: ${{ matrix.config.screenshot_filename }}
|
|
|
|
- name: Smoke Test Cleanup ( QSkinny ) on Windows
|
|
if: startsWith(matrix.config.name, 'Windows')
|
|
run: |
|
|
taskkill /IM iotdashboard.exe /T /F
|
|
|
|
- name: Smoke Test Cleanup ( QSkinny ) on MacOS
|
|
if: startsWith(matrix.config.name, 'macOS')
|
|
run: |
|
|
killall iotdashboard
|
|
|
|
- name: Smoke Test Cleanup ( QSkinny ) on Ubuntu
|
|
if: startsWith(matrix.config.name, 'Ubuntu')
|
|
run: |
|
|
killall iotdashboard
|
|
# killall Xvfb
|
|
|
|
- name: Configure ( CMake Integration Test )
|
|
shell: bash
|
|
run: |
|
|
mkdir qskinny_build_test
|
|
cmake \
|
|
-S qskinny_source/examples/iotdashboard_smoketest \
|
|
-B qskinny_build_test \
|
|
-G "${{ matrix.config.generators }}" \
|
|
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
|
|
-DCMAKE_PREFIX_PATH:PATH="${{ matrix.config.cmake.qtprefixpath }}" \
|
|
-D${{ matrix.config.cmake.qtdirkey }}:PATH="${{ matrix.config.cmake.qtdirvalue }}" \
|
|
-DQSkinny_DIR:PATH=$GITHUB_WORKSPACE/qskinny_install/lib/cmake/QSkinny
|
|
|
|
- name: Build ( CMake Integration Test )
|
|
env:
|
|
DISPLAY: ":1"
|
|
shell: bash
|
|
run: cmake --build qskinny_build_test --config ${{ matrix.config.build_type }}
|