2021-07-07 01:23:04 +00:00
|
|
|
name: 🖥️ Windows Builds
|
2020-09-11 05:56:45 +00:00
|
|
|
|
|
|
|
# Controls when the action will run. Triggers the workflow on push or pull request
|
|
|
|
# events but only for the master branch
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-10-18 04:17:47 +00:00
|
|
|
tags:
|
|
|
|
- v*
|
2020-09-11 05:56:45 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-09-18 01:19:04 +00:00
|
|
|
paths-ignore:
|
2021-05-07 13:45:52 +00:00
|
|
|
- '**/*.md'
|
|
|
|
- '.clang-format'
|
|
|
|
- '.codacy.yaml'
|
|
|
|
- '.github/*'
|
|
|
|
- '.github/workflows/lint-gamedb.yml'
|
|
|
|
- '.github/workflows/linux-workflow.yml'
|
|
|
|
- '.github/workflows/macos-workflow.yml'
|
|
|
|
- '.github/workflows/scripts/linux/**'
|
|
|
|
- '.github/workflows/scripts/validation/**'
|
|
|
|
- '.gitignore'
|
|
|
|
- 'bin/PCSX2_keys.ini.default'
|
|
|
|
- 'build.sh'
|
|
|
|
- 'buildbot.xml'
|
|
|
|
- 'linux_various/**'
|
|
|
|
- 'mscompile.cmd'
|
|
|
|
- 'pcsx2/CDVD/Linux/**'
|
|
|
|
- 'pcsx2/DEV9/Linux/**'
|
|
|
|
- 'pcsx2/Linux/**'
|
|
|
|
- 'pcsx2/PAD/Linux/**'
|
|
|
|
- 'pcsx2/SPU2/Linux/**'
|
|
|
|
- 'pcsx2/USB/linux/**'
|
2020-09-11 05:56:45 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
# Prevent one build from failing everything (although maybe those should be included as experimental builds instead)
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [windows-2019]
|
2021-11-07 03:40:20 +00:00
|
|
|
platform: [x64]
|
2022-01-31 15:12:19 +00:00
|
|
|
configuration: [Release, Release AVX2, CMake, Qt]
|
2020-09-11 05:56:45 +00:00
|
|
|
experimental: [false]
|
|
|
|
|
2022-03-18 23:08:20 +00:00
|
|
|
name: ${{ matrix.configuration }}
|
2020-09-11 05:56:45 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
continue-on-error: ${{ matrix.experimental }}
|
|
|
|
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
|
2021-08-11 19:55:14 +00:00
|
|
|
timeout-minutes: 60
|
2020-09-11 05:56:45 +00:00
|
|
|
|
2021-05-07 13:45:52 +00:00
|
|
|
env:
|
|
|
|
POWERSHELL_TELEMETRY_OPTOUT: 1
|
2021-08-11 19:55:14 +00:00
|
|
|
BUILDCACHE_COMPRESS_FORMAT: ZSTD
|
2021-09-02 03:43:08 +00:00
|
|
|
BUILDCACHE_COMPRESS_LEVEL: 9
|
|
|
|
BUILDCACHE_MAX_CACHE_SIZE: 536870912 # 512MB
|
2021-08-11 19:55:14 +00:00
|
|
|
BUILDCACHE_DIRECT_MODE: true
|
|
|
|
BUILDCACHE_LOG_FILE: ${{ github.workspace }}\buildcache.log
|
2021-05-07 13:45:52 +00:00
|
|
|
|
2020-09-11 05:56:45 +00:00
|
|
|
steps:
|
2020-09-18 18:26:32 +00:00
|
|
|
- name: Checkout Repository
|
2022-03-07 04:02:40 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-09-18 18:26:32 +00:00
|
|
|
|
|
|
|
- name: Checkout Submodules
|
2021-05-07 13:45:52 +00:00
|
|
|
run: git submodule update --init --recursive -j $env:NUMBER_OF_PROCESSORS
|
2020-09-11 05:56:45 +00:00
|
|
|
|
2021-08-11 19:55:14 +00:00
|
|
|
- name: Setup Buildcache
|
2021-11-07 03:40:20 +00:00
|
|
|
if: matrix.configuration == 'CMake' # TODO: buildcache on VS
|
2021-08-30 04:01:35 +00:00
|
|
|
uses: mikehardy/buildcache-action@v1.2.2
|
2021-08-11 19:55:14 +00:00
|
|
|
with:
|
|
|
|
cache_key: ${{ matrix.os }} ${{ matrix.platform }} ${{ matrix.configuration }}
|
|
|
|
|
2020-09-20 17:10:14 +00:00
|
|
|
- name: Verify VS Project Files
|
2021-08-11 04:26:49 +00:00
|
|
|
if: matrix.configuration != 'CMake'
|
2021-11-07 03:40:20 +00:00
|
|
|
run: .github\workflows\scripts\windows\validate-vs-filters.ps1
|
2020-09-20 17:10:14 +00:00
|
|
|
|
2020-09-11 05:56:45 +00:00
|
|
|
- name: Setup msbuild
|
2021-08-11 04:26:49 +00:00
|
|
|
if: matrix.configuration != 'CMake'
|
2021-11-07 03:40:20 +00:00
|
|
|
uses: microsoft/setup-msbuild@v1
|
2021-08-11 04:26:49 +00:00
|
|
|
|
2022-01-31 15:12:19 +00:00
|
|
|
- name: Download Qt build files
|
|
|
|
if: matrix.configuration == 'Qt'
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
cd 3rdparty\qt
|
2022-04-13 11:04:01 +00:00
|
|
|
aria2c https://github.com/PCSX2/pcsx2-windows-dependencies/releases/download/2022-04-13/qt-6.3.0-x64.7z
|
|
|
|
7z x qt-6.3.0-x64.7z
|
|
|
|
del qt-6.3.0-x64.7z
|
2022-01-31 15:12:19 +00:00
|
|
|
|
2021-08-11 04:26:49 +00:00
|
|
|
- name: Generate CMake
|
2021-11-07 03:40:20 +00:00
|
|
|
if: matrix.configuration == 'CMake'
|
2021-08-11 04:26:49 +00:00
|
|
|
id: cmake
|
2021-08-11 19:15:58 +00:00
|
|
|
shell: cmd
|
2021-08-11 04:26:49 +00:00
|
|
|
run: |
|
2021-08-11 19:15:58 +00:00
|
|
|
if "${{ github.event.inputs.retainDebugArtifacts }}"=="true" (SET type=RelWithDebInfo) else (SET type=Release)
|
|
|
|
if "${{ matrix.platform }}"=="Win32" (SET vcvars=vcvarsamd64_x86.bat) else (SET vcvars=vcvars64.bat)
|
|
|
|
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\%vcvars%"
|
|
|
|
echo ::set-output name=buildtype::%type%
|
|
|
|
echo ::set-output name=vcvars::%vcvars%
|
2021-09-02 03:43:08 +00:00
|
|
|
cmake . -B build -DCMAKE_BUILD_TYPE=%type% -DLTO_PCSX2_CORE=ON -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=..\buildcache\bin\buildcache.exe -DCMAKE_CXX_COMPILER_LAUNCHER=..\buildcache\bin\buildcache.exe -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
|
2020-09-11 05:56:45 +00:00
|
|
|
|
|
|
|
- name: Build PCSX2
|
2021-08-11 19:15:58 +00:00
|
|
|
shell: cmd
|
2021-01-24 22:56:12 +00:00
|
|
|
env:
|
|
|
|
# Set to 'true' to retain the .pdb / .exp / .lib, etc files which can be useful for repro'ing issues that only occur in the compiled .exe
|
2021-04-20 02:21:39 +00:00
|
|
|
RetainDebuggingArtifacts: ${{ github.event.inputs.retainDebugArtifacts == 'true' }}
|
2021-08-11 04:26:49 +00:00
|
|
|
run: |
|
2021-08-11 19:15:58 +00:00
|
|
|
if "${{ matrix.configuration }}"=="CMake" (
|
|
|
|
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ steps.cmake.outputs.vcvars }}"
|
2021-08-11 04:26:49 +00:00
|
|
|
cmake --build build --config ${{ steps.cmake.outputs.buildtype }}
|
2021-08-11 19:15:58 +00:00
|
|
|
) else (
|
2022-01-31 15:12:19 +00:00
|
|
|
if "${{ matrix.configuration }}"=="Qt" (
|
|
|
|
rem This is hardcoded to Release AVX2 for now, because of the artifact naming below.
|
|
|
|
msbuild "PCSX2_qt.sln" /m /v:m /p:Configuration="Release AVX2" /p:Platform="${{ matrix.platform }}"
|
|
|
|
) else (
|
|
|
|
msbuild "PCSX2_suite.sln" /m /v:m /p:Configuration="${{ matrix.configuration }}" /p:Platform="${{ matrix.platform }}"
|
|
|
|
)
|
2021-08-11 19:15:58 +00:00
|
|
|
)
|
2020-09-11 05:56:45 +00:00
|
|
|
|
2021-08-13 03:55:20 +00:00
|
|
|
- name: Run Tests
|
2021-11-07 03:40:20 +00:00
|
|
|
if: matrix.configuration == 'CMake'
|
2021-08-13 03:55:20 +00:00
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ steps.cmake.outputs.vcvars }}"
|
|
|
|
cmake --build build --config ${{ steps.cmake.outputs.buildtype }} --target unittests
|
|
|
|
|
2021-01-07 00:52:32 +00:00
|
|
|
- name: Prepare Artifact Metadata
|
|
|
|
id: artifact-metadata
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
ARCH=$([ "${{ matrix.platform }}" == Win32 ] && echo "32bit" || echo "64bit")
|
2021-08-11 04:26:49 +00:00
|
|
|
case "${{ matrix.configuration }}" in
|
|
|
|
Release) SIMD="SSE4";;
|
|
|
|
*AVX2) SIMD="AVX2";;
|
2022-01-31 15:12:19 +00:00
|
|
|
Qt) SIMD="QT";;
|
2021-08-11 04:26:49 +00:00
|
|
|
CMake) SIMD="CMake"
|
2021-12-04 23:45:23 +00:00
|
|
|
cp build/pcsx2/pcsx2* bin/ ;;
|
2021-08-11 04:26:49 +00:00
|
|
|
*) SIMD="UNKNOWN";;
|
|
|
|
esac
|
2021-01-07 00:52:32 +00:00
|
|
|
if [ ${{ github.event_name }} == "pull_request" ]; then
|
|
|
|
PR_SHA=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
|
2021-07-07 01:23:04 +00:00
|
|
|
ARTIFACT_NAME="PCSX2-${ARCH}-${SIMD}"
|
2021-01-07 00:52:32 +00:00
|
|
|
if [ ! -z "${{ github.event.pull_request.number }}" ]; then
|
|
|
|
PR_NUM=${{ github.event.pull_request.number }}
|
|
|
|
ARTIFACT_NAME="${ARTIFACT_NAME}-pr[${PR_NUM}]"
|
|
|
|
fi
|
|
|
|
ARTIFACT_NAME="${ARTIFACT_NAME}-sha[${PR_SHA}]"
|
|
|
|
if [ ! -z "${{ github.event.pull_request.title }}" ]; then
|
|
|
|
PR_TITLE=$(echo "${{ github.event.pull_request.title }}" | tr -cd '[a-zA-Z0-9[:space:]]_-')
|
|
|
|
ARTIFACT_NAME="${ARTIFACT_NAME}-title["${PR_TITLE}""
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
SHA=$(git rev-parse --short "$GITHUB_SHA")
|
2021-07-07 01:23:04 +00:00
|
|
|
ARTIFACT_NAME="PCSX2-${ARCH}-${SIMD}-sha[${SHA}"
|
2021-01-07 00:52:32 +00:00
|
|
|
fi
|
|
|
|
TRIMMED_ARTIFACT_NAME=$(printf "%.199s]" "$ARTIFACT_NAME")
|
|
|
|
echo "name=$TRIMMED_ARTIFACT_NAME"
|
|
|
|
echo "##[set-output name=name;]${TRIMMED_ARTIFACT_NAME}"
|
2021-10-18 04:17:47 +00:00
|
|
|
echo "##[set-output name=arch;]${ARCH}"
|
|
|
|
echo "##[set-output name=simd;]${SIMD}"
|
2021-01-07 00:52:32 +00:00
|
|
|
|
2020-09-11 05:56:45 +00:00
|
|
|
- name: Upload artifact
|
2022-04-11 04:02:20 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-09-11 05:56:45 +00:00
|
|
|
continue-on-error: true
|
|
|
|
with:
|
2021-01-07 00:52:32 +00:00
|
|
|
name: ${{ steps.artifact-metadata.outputs.name }}
|
2021-10-18 04:17:47 +00:00
|
|
|
path: |
|
|
|
|
./bin
|
|
|
|
!./bin/**/*.bsc
|
|
|
|
!./bin/**/*.exp
|
|
|
|
!./bin/**/*.ilk
|
|
|
|
!./bin/**/*.iobj
|
|
|
|
!./bin/**/*.ipdb
|
|
|
|
!./bin/**/*.pdb
|
|
|
|
!./bin/**/*.lib
|
|
|
|
|
|
|
|
- name: Upload artifact - with symbols
|
|
|
|
if: matrix.configuration != 'CMake'
|
2022-04-11 04:02:20 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-10-18 04:17:47 +00:00
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
name: ${{ steps.artifact-metadata.outputs.name }}-symbols
|
2021-10-19 00:42:48 +00:00
|
|
|
path: ./bin/**/*.pdb
|
2021-10-18 04:17:47 +00:00
|
|
|
|
|
|
|
# ---- Release / Tagging related steps ----
|
|
|
|
- name: Prepare Build Artifacts
|
2022-01-31 15:12:19 +00:00
|
|
|
if: github.repository == 'PCSX2/pcsx2' && startsWith(github.ref, 'refs/tags/') && matrix.configuration != 'CMake' && matrix.configuration != 'Qt'
|
2021-10-18 04:17:47 +00:00
|
|
|
run: |
|
|
|
|
mkdir -p ./ci-artifacts/
|
|
|
|
7z a ./ci-artifacts/windows-${{ steps.artifact-metadata.outputs.arch }}-${{ steps.artifact-metadata.outputs.simd }}.7z ./bin/* '-xr!*bsc' '-xr!*.exp' '-xr!*.ilk' '-xr!*.iobj' '-xr!*.ipdb' '-xr!*.pdb' '-xr!*.lib'
|
|
|
|
7z a ./ci-artifacts/windows-${{ steps.artifact-metadata.outputs.arch }}-${{ steps.artifact-metadata.outputs.simd }}-symbols.7z ./bin/*.pdb
|
|
|
|
ls ./ci-artifacts/
|
|
|
|
|
|
|
|
- name: Upload Assets and Potential Publish Release
|
2022-01-31 15:12:19 +00:00
|
|
|
if: github.repository == 'PCSX2/pcsx2' && startsWith(github.ref, 'refs/tags/') && matrix.configuration != 'CMake' && matrix.configuration != 'Qt'
|
2021-10-18 04:17:47 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
|
|
|
|
ASSET_DIR: ${{ github.WORKSPACE }}/ci-artifacts
|
2021-10-19 00:42:48 +00:00
|
|
|
ASSET_EXTENSION: 7z
|
2021-10-18 04:17:47 +00:00
|
|
|
TAG_TO_SEARCH_FOR: ${{ github.REF }}
|
|
|
|
run: |
|
|
|
|
cd ./.github/workflows/scripts/releases/upload-release-artifacts
|
|
|
|
npm ci
|
|
|
|
node index.js
|