Skip to content

Commit

Permalink
[CI] Github Actions: Workflow for QT - Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Gliniak committed Mar 5, 2024
1 parent 2d4a7db commit 46b7bd3
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: CI

on:
push:
paths-ignore:
- '.clang-format'
- '.drone.star'
- '.gitattributes'
- '.gitignore'
- '.gdbinit'
- '.github/*'
- '.github/*_TEMPLATE/**'
- '*.md'
- '*.yml'
- 'docs/**'
- 'src/**/*_posix.*'
- 'src/**/*_linux.*'
- 'src/**/*_gnulinux.*'
- 'src/**/*_x11.*'
- 'src/**/*_gtk.*'
- 'src/**/*_android.*'
- 'src/**/*_mac.*'
- 'LICENSE'
pull_request:
paths-ignore:
- '.clang-format'
- '.drone.star'
- '.gitattributes'
- '.gitignore'
- '.gdbinit'
- '.github/*'
- '.github/*_TEMPLATE/**'
- '*.md'
- '*.yml'
- 'docs/**'
- 'src/**/*_posix.*'
- 'src/**/*_linux.*'
- 'src/**/*_gnulinux.*'
- 'src/**/*_x11.*'
- 'src/**/*_gtk.*'
- 'src/**/*_android.*'
- 'src/**/*_mac.*'
- 'LICENSE'
workflow_dispatch:

jobs:
build-windows-qt:
name: Build QT Version (Windows, ${{ matrix.config.vsver }}) # runner.os can't be used here
runs-on: ${{ matrix.config.runs-on }}
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
strategy:
fail-fast: false
matrix:
config:
- {vsver: VS2022, runs-on: windows-latest}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get QT binaries
shell: cmd
run: |
cd third_party/qt_binary
aria2c http://qt.mirror.constant.com/online/qtsdkrepository/windows_x86/desktop/qt6_652/qt.qt6.652.win64_msvc2019_64/6.5.2-0-202307080351qtbase-Windows-Windows_10_22H2-MSVC2019-Windows-Windows_10_22H2-X86_64.7z
7z x *.7z -o. -r
del *.7z
- name: Setup
run: .\xb setup

- name: Build GUI Test App
run: .\xb build --config=Release --target=demos\xenia-ui-qt-demoapp

- name: Prepare artifacts
run: |
mkdir artifacts\xenia_qt\platforms
robocopy . build\bin\${{ runner.os }}\Release LICENSE /r:0 /w:0
robocopy build\bin\${{ runner.os }}\Release artifacts\xenia_qt xenia-ui-qt-demoapp.exe LICENSE /r:0 /w:0
robocopy third_party\qt_binary\6.5.2\msvc2019_64\bin\ artifacts\xenia_qt Qt6Core.dll /r:0 /w:0
robocopy third_party\qt_binary\6.5.2\msvc2019_64\bin\ artifacts\xenia_qt Qt6Gui.dll /r:0 /w:0
robocopy third_party\qt_binary\6.5.2\msvc2019_64\bin\ artifacts\xenia_qt Qt6Widgets.dll /r:0 /w:0
robocopy third_party\qt_binary\6.5.2\msvc2019_64\plugins\platforms\ artifacts\xenia_qt\platforms qwindows.dll /r:0 /w:0
If ($LastExitCode -le 7) { echo "LastExitCode = $LastExitCode";$LastExitCode = 0 }
- name: Upload xenia artifacts
uses: actions/upload-artifact@v4
with:
name: xenia_qt_${{ matrix.config.vsver }}
path: artifacts\xenia_qt
if-no-files-found: error

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$asset="xenia_qt.zip"
rm -recurse -force artifacts\xenia_qt\*.pdb # Ideally this would use xr, but I can't get it to work
7z a $asset .\artifacts\xenia_qt\*
If ($(Get-Item $asset).length -le 100000) {
Throw "Error: Archive $asset too small!"
}
$tag=$env:GITHUB_SHA.SubString(0,7)
$branch=$($env:GITHUB_REF -replace 'refs/heads/')
$title="${tag}_$branch"
gh release create $tag $asset --target $env:GITHUB_SHA -t $title
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,9 @@ node_modules/.bin/
/third_party/binutils/binutils*
/third_party/vasm/
/tools/shader-playground/*.dll

# ==============================================================================
# QT binaries directory
# ==============================================================================

/third_party/qt_binary/
12 changes: 12 additions & 0 deletions src/xenia/ui/qt/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ project("xenia-ui-qt")

-- Setup Qt libraries
qt.enable()
filter("platforms:Linux")
qtpath "../../../../third_party/qt_binary/6.5.2/gcc_64"

filter("platforms:Windows")
qtpath "../../../../third_party/qt_binary/6.5.2/msvc2019_64"

qtmodules{"core", "gui", "widgets"}
qtprefix "Qt6"

Expand Down Expand Up @@ -52,6 +58,12 @@ project("xenia-ui-qt-demoapp")

-- Setup Qt libraries
qt.enable()
filter("platforms:Linux")
qtpath "../../../../third_party/qt_binary/6.5.2/gcc_64"

filter("platforms:Windows")
qtpath "../../../../third_party/qt_binary/6.5.2/msvc2019_64"

qtmodules{"core", "gui", "widgets"}
qtprefix "Qt6"

Expand Down
1 change: 1 addition & 0 deletions third_party/qt_binary/Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Empty directory for automatic QT binaries download.

0 comments on commit 46b7bd3

Please sign in to comment.