Skip to content

Commit

Permalink
[CI][premake] Use Qt5.15.0 and Qt6.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarod42 committed Jun 8, 2024
1 parent 1acff49 commit 2221816
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 10 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,28 @@ jobs:
linux:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
include:
- qt-version: '5.15.0'
qt-major-version: 'Qt5'
- qt-version: '6.0.4'
qt-major-version: 'Qt6'
# In qt6.1+, moc/uic/rcc binaries have been move from usr/bin to usr/lib/qt6/

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Installing Qt5.15.0 ubuntu
- name: Installing Qt${{matrix.qt-version}} ubuntu
uses: jurplel/install-qt-action@v4
with:
version: '5.15.0'
version: ${{matrix.qt-version}}
cache: true
cache-key-prefix: 'qt-action@v4-Qt5.15.0_ubuntu'
cache-key-prefix: 'qt-action@v4-Qt${{matrix.qt-version}}_ubuntu'

- name: set path
run: |
Expand Down Expand Up @@ -53,7 +63,7 @@ jobs:
- name: build with premake
run: |
./premake5 gmake2 && cd solution/gmake2 && make config=release_x64
./premake5 gmake2 --qt-version=${{matrix.qt-major-version}} && cd solution/gmake2 && make config=release_x64
#
# - name: install libxkbcommon-x11-0 # display dependency
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/windows_premake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,30 @@ jobs:
windows:
runs-on: windows-latest

strategy:
fail-fast: true
matrix:
include:
- qt-version: '5.15.0'
qt-major-version: 'Qt5'
qt-arch: 'win64_msvc2019_64' # No 2022 version yet
- qt-version: '6.0.4'
qt-major-version: 'Qt6'
qt-arch: 'win64_msvc2019_64' # No 2022 version yet

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Installing Qt - 5.15.0 win64_msvc2019_64 # No 2022 version yet
- name: Installing Qt - ${{matrix.qt-version}} ${{matrix.qt-arch}}
uses: jurplel/install-qt-action@v4
with:
version: '5.15.0'
arch: win64_msvc2019_64
version: ${{matrix.qt-version}}
arch: ${{matrix.qt-arch}}
cache: true
cache-key-prefix: 'qt-action@v4-Qt5.15.0_win64_msvc2019_64'
cache-key-prefix: 'qt-action@v4-Qt${{matrix.qt-version}}_${{matrix.qt-arch}}'

# Premake
- name: checkout premake5
Expand All @@ -40,12 +51,12 @@ jobs:

- name: build with premake
run: |
./premake5 vs2022 --qt-root=$Env:QT_ROOT_DIR && cd solution/vs2022 && msbuild.exe /property:Configuration=Release /property:Platform=x64 qt-json-editor.sln
./premake5 vs2022 --qt-root=$Env:QT_ROOT_DIR --qt-version=${{matrix.qt-major-version}} && cd solution/vs2022 && msbuild.exe /property:Configuration=Release /property:Platform=x64 qt-json-editor.sln
- name: Upload
uses: actions/upload-artifact@v4
with:
name: qt-json-editor
name: qt-json-editor-qt${{matrix.qt-version}}
path: |
bin/vs2022/x64/Release/*.*
${{ env.QT_ROOT_DIR }}/plugins/designer/qt-json-designer-plugin.*
4 changes: 4 additions & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ workspace "qt-json-editor"
end
qtprefix ( _OPTIONS["qt-version"] )

if _OPTIONS["qt-version"] == 'Qt6' then
forceinclude "src/Qt6_0_workaround.h"
end

filter "platforms:x32"
architecture "x32"
filter "platforms:x64"
Expand Down
8 changes: 8 additions & 0 deletions src/Qt6_0_workaround.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

#if 1 // Workaround for QT6.0.x bug
# include <QtGlobal>
# if (QT_VERSION_CHECK(6, 0, 0) <= QT_VERSION) && (QT_VERSION <= QT_VERSION_CHECK(6, 1, 0))
# include <limits>
# endif
#endif

0 comments on commit 2221816

Please sign in to comment.