merge again #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2019-2020-2021 Luca Cappa | |
# Released under the term specified in file LICENSE.txt | |
# SPDX short identifier: MIT | |
name: Build and test | |
on: | |
push: | |
# branches: ["main"] | |
jobs: | |
build-cmake: | |
name: Build ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
# see https://gist.github.com/NickNaso/0d478f1481686d5bcc868cac06620a60 | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "Windows MSVC", | |
build_dir: "windows-msvc", | |
os: windows-2022, | |
build_type: "Release", | |
cc: "cl", | |
cxx: "cl", | |
generators: "Ninja", | |
} | |
# - { | |
# name: "Windows MinGW", | |
# build_dir: "windows-mingw", | |
# os: windows-latest, | |
# build_type: "Release", | |
# cc: "gcc", | |
# cxx: "g++", | |
# generators: "Ninja" | |
# } | |
- { | |
name: "Windows Clang 16", | |
build_dir: "windows-clang", | |
os: windows-2022, | |
build_type: "Release", | |
cc: "clang", | |
cxx: "clang++", | |
generators: "Ninja", | |
} | |
- { | |
name: "Ubuntu GCC", | |
build_dir: "ubuntu-gcc", | |
os: ubuntu-22.04, | |
build_type: "Release", | |
cc: "gcc", | |
cxx: "g++", | |
generators: "Ninja", | |
} | |
- { | |
name: "Ubuntu Clang", | |
build_dir: "ubuntu-clang", | |
os: ubuntu-22.04, | |
build_type: "Release", | |
cc: "clang", | |
cxx: "clang++", | |
generators: "Ninja", | |
} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: lukka/get-cmake@latest | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: 6.7.1 | |
modules: "qt5compat" | |
cache: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install cmake-format | |
run: pip3 install cmake-format | |
- name: Setup MSVC (optional) | |
if: ${{ matrix.config.cxx == 'cl' }} | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Confiure | |
working-directory: ${{ github.workspace }} | |
id: runcmake | |
run: | | |
pwd | |
cmake -B "build/${{ matrix.config.build_dir }}" -G "${{ matrix.config.generators }}" -DCMAKE_BUILD_TYPE="${{ matrix.config.build_type }}" -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} | |
pwd | |
- name: Build | |
working-directory: ${{ github.workspace }} | |
id: runcmakebuild | |
run: | | |
cmake --build "build/${{ matrix.config.build_dir }}" --parallel --verbose | |
- name: Install | |
working-directory: ${{ github.workspace }} | |
id: runcmakeinstall | |
run: | | |
cmake --install "build/${{ matrix.config.build_dir }}" --prefix="dist/${{ matrix.config.build }}/usr" | |
- name: Create AppImage (linux) | |
if: matrix.config.os == 'ubuntu-22.04' && matrix.config.cc == 'gcc' | |
run: | | |
export LD_LIBRARY_PATH=dist/${{ matrix.config.build }}:$LD_LIBRARY_PATH | |
export OUTPUT=build/qtedit4-qt671-x86_64.AppImage | |
sudo apt install fuse libxkbcommon-x11-0 libxcb-cursor-dev libxkbcommon-dev | |
wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" | |
wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" | |
chmod +x linuxdeploy*.AppImage | |
./linuxdeploy-x86_64.AppImage --appdir "dist/${{ matrix.config.build }}" --plugin qt --output appimage | |
working-directory: ${{ github.workspace }}/build/dist | |
- name: Upload AppImage | |
if: matrix.config.os == 'ubuntu-22.04' && matrix.config.cc == 'gcc' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qtedit4-qt671-x86_64.AppImage | |
path: build/qtedit4-qt671-x86_64.AppImage | |
# - name: Create AppImage (linux) | |
# if: matrix.config.os == 'ubuntu-22.04' && matrix.config.cc == 'gcc' | |
# run: | | |
# export LD_LIBRARY_PATH=${{ github.workspace }}/build/dist/usr/lib/:$LD_LIBRARY_PATH | |
# export OUTPUT=${{ runner.workspace }}/build/qtedit4-qt671-x86_64.AppImage | |
# sudo apt install fuse libxkbcommon-x11-0 libxcb-cursor-dev libxkbcommon-dev | |
# wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" | |
# wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" | |
# chmod +x linuxdeploy*.AppImage | |
# cmake --install ${{ runner.workspace }}/build/${{ runner.config.build_dir }} --prefix=${{ github.workspace }}/cbuild/dist/usr/ | |
# ./linuxdeploy-x86_64.AppImage --appdir ${{ github.workspace }}/cbuild/dist/ --plugin qt --output appimage | |
# working-directory: ${{ runner.workspace }}/build/${{ runner.config.build_dir }} | |
# - name: Upload AppImage | |
# if: ${{ matrix.config.os == 'ubuntu-22.04' && matrix.config.cc == 'gcc' }} | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: qtedit4-qt671-x86_64.AppImage | |
# path: ${{ runner.workspace }}/build/qtedit4-qt671-x86_64.AppImage | |
# - name: Install locally - windows | |
# if: matrix.config.os == 'windows-2022' && matrix.config.cc == 'cl' | |
# run: | | |
# cmake --install "${{ runner.workspace }}/build/" --prefix=${{ github.workspace }}/build/dist/ | |
# dir /s | |
# - name: Create MSI installer (Windows) | |
# if: matrix.config.os == 'windows-2022' && matrix.config.cc == 'cl' | |
# uses: Minionguyjpro/[email protected] | |
# with: | |
# path: "setup_script.iss" | |
# - name: Upload MSI | |
# if: matrix.config.os == 'windows-2022' && matrix.config.cc == 'cl' | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: qtedit4-qt671-x86_64.msi | |
# path: ${{ runner.workspace }}/build/qtedit4-qt671-x86_64.msi | |