From 46b7bd3cd4219a2cdf5e0ead22fd697383d609f8 Mon Sep 17 00:00:00 2001 From: Gliniak Date: Sun, 13 Aug 2023 19:48:13 +0200 Subject: [PATCH] [CI] Github Actions: Workflow for QT - Windows --- .github/workflows/CI.yml | 109 +++++++++++++++++++++++++++++++ .gitignore | 6 ++ src/xenia/ui/qt/premake5.lua | 12 ++++ third_party/qt_binary/Readme.txt | 1 + 4 files changed, 128 insertions(+) create mode 100644 .github/workflows/CI.yml create mode 100644 third_party/qt_binary/Readme.txt diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000000..712ce71664 --- /dev/null +++ b/.github/workflows/CI.yml @@ -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 diff --git a/.gitignore b/.gitignore index 140103405b..849e8968d3 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/src/xenia/ui/qt/premake5.lua b/src/xenia/ui/qt/premake5.lua index ee13d1fac1..99e4ee3ce8 100644 --- a/src/xenia/ui/qt/premake5.lua +++ b/src/xenia/ui/qt/premake5.lua @@ -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" @@ -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" diff --git a/third_party/qt_binary/Readme.txt b/third_party/qt_binary/Readme.txt new file mode 100644 index 0000000000..d265f57be6 --- /dev/null +++ b/third_party/qt_binary/Readme.txt @@ -0,0 +1 @@ +Empty directory for automatic QT binaries download. \ No newline at end of file