2022-05-14 05:56:57 +00:00
|
|
|
name: Windows Build Steps - Qt
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
jobName:
|
|
|
|
required: true
|
|
|
|
type: string
|
2024-01-06 20:44:44 +00:00
|
|
|
artifactPrefixName:
|
|
|
|
required: true
|
|
|
|
type: string
|
2022-05-14 05:56:57 +00:00
|
|
|
os:
|
|
|
|
required: false
|
|
|
|
type: string
|
2022-11-20 05:03:59 +00:00
|
|
|
default: windows-2022
|
2022-05-14 05:56:57 +00:00
|
|
|
platform:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: x64
|
|
|
|
configuration:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
simd:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: AVX2
|
2022-05-23 03:33:32 +00:00
|
|
|
buildSystem:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: msbuild
|
2023-01-26 04:15:28 +00:00
|
|
|
cmakeFlags:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: ""
|
2023-07-20 01:44:20 +00:00
|
|
|
patchesUrl:
|
2022-08-04 19:33:37 +00:00
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: https://github.com/PCSX2/pcsx2_patches/releases/latest/download
|
2023-07-20 01:44:20 +00:00
|
|
|
fetchTags:
|
|
|
|
required: false
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2024-01-11 00:04:42 +00:00
|
|
|
stableBuild:
|
|
|
|
required: false
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2022-05-14 05:56:57 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_windows_qt:
|
|
|
|
name: ${{ inputs.jobName }}
|
|
|
|
runs-on: ${{ inputs.os }}
|
|
|
|
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
|
2023-07-19 12:52:25 +00:00
|
|
|
timeout-minutes: 90
|
2022-05-14 05:56:57 +00:00
|
|
|
env:
|
|
|
|
POWERSHELL_TELEMETRY_OPTOUT: 1
|
|
|
|
|
|
|
|
steps:
|
2024-06-06 19:56:28 +00:00
|
|
|
- name: Tempfix Clang
|
|
|
|
if: inputs.configuration == 'CMake'
|
2024-06-07 05:21:25 +00:00
|
|
|
run: choco uninstall llvm
|
2024-06-06 19:56:28 +00:00
|
|
|
|
2022-05-14 05:56:57 +00:00
|
|
|
- name: Checkout Repository
|
2023-09-11 04:33:40 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-05-14 05:56:57 +00:00
|
|
|
|
2023-07-11 07:10:03 +00:00
|
|
|
# actions/checkout elides tags, fetch them primarily for releases
|
|
|
|
- name: Fetch Tags
|
2023-07-20 01:44:20 +00:00
|
|
|
if: ${{ inputs.fetchTags }}
|
2023-07-11 07:10:03 +00:00
|
|
|
run: git fetch --tags --no-recurse-submodules
|
|
|
|
|
2024-01-11 00:04:42 +00:00
|
|
|
- name: Add stable release identifier file
|
|
|
|
if: ${{ inputs.stableBuild == true || inputs.stableBuild == 'true' }}
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "#define DEFAULT_UPDATER_CHANNEL \"stable\"" > ./pcsx2-qt/DefaultUpdaterChannel.h
|
|
|
|
cat ./pcsx2-qt/DefaultUpdaterChannel.h
|
|
|
|
|
2022-05-14 05:56:57 +00:00
|
|
|
- name: Prepare Artifact Metadata
|
|
|
|
id: artifact-metadata
|
|
|
|
shell: bash
|
|
|
|
env:
|
2024-01-06 20:44:44 +00:00
|
|
|
PREFIX: ${{ inputs.artifactPrefixName }}
|
2022-05-14 05:56:57 +00:00
|
|
|
EVENT_NAME: ${{ github.event_name }}
|
|
|
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
|
|
PR_NUM: ${{ github.event.pull_request.number }}
|
|
|
|
PR_SHA: ${{ github.event.pull_request.head.sha }}
|
|
|
|
run: ./.github/workflows/scripts/common/name-artifacts.sh
|
|
|
|
|
|
|
|
- name: Setup msbuild
|
|
|
|
if: inputs.configuration != 'CMake'
|
2024-03-24 16:45:58 +00:00
|
|
|
uses: microsoft/setup-msbuild@v2
|
2022-05-14 05:56:57 +00:00
|
|
|
|
2023-05-26 10:33:51 +00:00
|
|
|
- name: Download patches
|
2022-08-04 19:33:37 +00:00
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
cd bin/resources
|
2023-07-20 01:44:20 +00:00
|
|
|
aria2c -Z "${{ inputs.patchesUrl }}/patches.zip"
|
2022-08-04 19:33:37 +00:00
|
|
|
|
2023-07-19 12:52:25 +00:00
|
|
|
- name: Cache Dependencies
|
|
|
|
id: cache-deps
|
2024-03-24 16:45:58 +00:00
|
|
|
uses: actions/cache@v4
|
2023-07-19 12:52:25 +00:00
|
|
|
with:
|
|
|
|
path: deps
|
|
|
|
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/windows/build-dependencies.bat') }}
|
|
|
|
|
|
|
|
- name: Build Dependencies
|
|
|
|
if: steps.cache-deps.outputs.cache-hit != 'true'
|
|
|
|
env:
|
|
|
|
DEBUG: 0
|
|
|
|
run: .github/workflows/scripts/windows/build-dependencies.bat
|
|
|
|
|
2022-08-22 06:46:13 +00:00
|
|
|
- name: Generate CMake
|
|
|
|
if: inputs.configuration == 'CMake'
|
|
|
|
id: cmake
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
2022-11-20 05:03:59 +00:00
|
|
|
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
2023-07-19 12:52:25 +00:00
|
|
|
cmake . -B build ${{ inputs.cmakeFlags }} "-DCMAKE_PREFIX_PATH=%cd%\deps" -DQT_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DDISABLE_ADVANCE_SIMD=ON -G Ninja
|
2022-08-22 06:46:13 +00:00
|
|
|
|
2022-05-14 05:56:57 +00:00
|
|
|
- name: Build PCSX2
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
if "${{ inputs.configuration }}"=="CMake" (
|
2022-11-20 05:03:59 +00:00
|
|
|
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
2022-08-22 06:46:13 +00:00
|
|
|
cmake --build build --config Release || exit /b
|
2022-08-28 18:11:22 +00:00
|
|
|
cmake --install build --config Release || exit /b
|
2022-05-14 05:56:57 +00:00
|
|
|
) else (
|
2022-05-16 23:12:26 +00:00
|
|
|
msbuild "PCSX2_qt.sln" /m /v:m /p:Configuration="${{ inputs.configuration }}" /p:Platform="${{ inputs.platform }}"
|
2022-05-14 05:56:57 +00:00
|
|
|
)
|
|
|
|
|
2023-01-03 12:23:10 +00:00
|
|
|
- name: Run Tests
|
|
|
|
if: inputs.configuration == 'CMake'
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
2024-03-28 06:33:55 +00:00
|
|
|
set PATH=%PATH%;%GITHUB_WORKSPACE%\bin
|
2023-01-03 12:23:10 +00:00
|
|
|
cmake --build build --config Release --target unittests
|
|
|
|
|
2022-05-14 05:56:57 +00:00
|
|
|
- name: Upload artifact
|
2024-01-06 20:44:44 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-05-14 05:56:57 +00:00
|
|
|
with:
|
|
|
|
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
|
|
|
|
path: |
|
|
|
|
./bin
|
|
|
|
!./bin/**/*.bsc
|
|
|
|
!./bin/**/*.exp
|
|
|
|
!./bin/**/*.ilk
|
|
|
|
!./bin/**/*.iobj
|
|
|
|
!./bin/**/*.ipdb
|
|
|
|
!./bin/**/*.pdb
|
|
|
|
!./bin/**/*.lib
|
|
|
|
|
|
|
|
- name: Upload artifact - with symbols
|
2024-01-06 20:44:44 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-05-14 05:56:57 +00:00
|
|
|
with:
|
|
|
|
name: ${{ steps.artifact-metadata.outputs.artifact-name }}-symbols
|
|
|
|
path: ./bin/**/*.pdb
|