Add github actions for windows llvm
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 34s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped

This commit is contained in:
Megamouse 2025-06-12 19:07:54 +02:00
parent af0432a44b
commit ab55500f01
6 changed files with 177 additions and 2 deletions

20
.ci/deploy-llvm.sh Normal file
View file

@ -0,0 +1,20 @@
#!/bin/sh -ex
# First let's print some info about our caches
"$(cygpath -u "$CCACHE_BIN_DIR")"/ccache.exe --show-stats -v
# BUILD_blablabla is Azure specific, so we wrap it for portability
ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY"
BUILD="llvmlibs_mt.7z"
# Package artifacts
7z a -m0=LZMA2 -mx9 "$BUILD" ./build/lib/Release-x64/llvm_build
# Generate sha256 hashes
# Write to file for GitHub releases
sha256sum "$BUILD" | awk '{ print $1 }' | tee "$BUILD.sha256"
echo "$(cat "$BUILD.sha256");$(stat -c %s "$BUILD")B" > GitHubReleaseMessage.txt
# Move files to publishing directory
cp -- "$BUILD" "$ARTIFACT_DIR"
cp -- "$BUILD.sha256" "$ARTIFACT_DIR"

View file

@ -1,6 +1,6 @@
#!/bin/sh -ex
# First let's see print some info about our caches
# First let's print some info about our caches
"$(cygpath -u "$CCACHE_BIN_DIR")"/ccache.exe --show-stats -v
# BUILD_blablabla is Azure specific, so we wrap it for portability

63
.ci/setup-llvm.sh Normal file
View file

@ -0,0 +1,63 @@
#!/bin/sh -ex
# Resource/dependency URLs
CCACHE_URL="https://github.com/ccache/ccache/releases/download/v4.11.2/ccache-4.11.2-windows-x86_64.zip"
DEP_URLS=" \
$CCACHE_URL"
# CI doesn't make a cache dir if it doesn't exist, so we do it manually
[ -d "$DEPS_CACHE_DIR" ] || mkdir "$DEPS_CACHE_DIR"
# Pull the llvm submodule
# shellcheck disable=SC2046
git submodule -q update --init --depth=1 -- 3rdparty/llvm
# Git bash doesn't have rev, so here it is
rev()
{
echo "$1" | awk '{ for(i = length($0); i != 0; --i) { a = a substr($0, i, 1); } } END { print a }'
}
# Usage: download_and_verify url checksum algo file
# Check to see if a file is already cached, and the checksum matches. If not, download it.
# Tries up to 3 times
download_and_verify()
{
url="$1"
correctChecksum="$2"
algo="$3"
fileName="$4"
for _ in 1 2 3; do
[ -e "$DEPS_CACHE_DIR/$fileName" ] || curl -fLo "$DEPS_CACHE_DIR/$fileName" "$url"
fileChecksum=$("${algo}sum" "$DEPS_CACHE_DIR/$fileName" | awk '{ print $1 }')
[ "$fileChecksum" = "$correctChecksum" ] && return 0
done
return 1;
}
# Some dependencies install here
[ -d "./build/lib_ext/Release-x64" ] || mkdir -p "./build/lib_ext/Release-x64"
for url in $DEP_URLS; do
# Get the filename from the URL and remove query strings (?arg=something).
fileName="$(rev "$(rev "$url" | cut -d'/' -f1)" | cut -d'?' -f1)"
[ -z "$fileName" ] && echo "Unable to parse url: $url" && exit 1
# shellcheck disable=SC1003
case "$url" in
*ccache*) checksum=$CCACHE_SHA; algo="sha256"; outDir="$CCACHE_BIN_DIR" ;;
*) echo "Unknown url resource: $url"; exit 1 ;;
esac
download_and_verify "$url" "$checksum" "$algo" "$fileName"
7z x -y "$DEPS_CACHE_DIR/$fileName" -aos -o"$outDir"
done
# Setup ccache tool
[ -d "$CCACHE_DIR" ] || mkdir -p "$(cygpath -u "$CCACHE_DIR")"
CCACHE_SH_DIR=$(cygpath -u "$CCACHE_BIN_DIR")
mv "$CCACHE_SH_DIR"/ccache-*/* "$CCACHE_SH_DIR"
cp "$CCACHE_SH_DIR"/ccache.exe "$CCACHE_SH_DIR"/cl.exe

72
.github/workflows/llvm.yml vendored Normal file
View file

@ -0,0 +1,72 @@
name: Build LLVM
defaults:
run:
shell: bash
on:
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
BUILD_ARTIFACTSTAGINGDIRECTORY: ${{ github.workspace }}/artifacts/
jobs:
Windows_Build:
if: github.event_name == 'workflow_dispatch'
name: LLVM Windows (MSVC)
runs-on: windows-2025
env:
COMPILER: msvc
CCACHE_SHA: '1f39f3ad5aae3fe915e99ad1302633bc8f6718e58fa7c0de2b0ba7e080f0f08c'
CCACHE_BIN_DIR: 'C:\ccache_bin'
CCACHE_DIR: 'C:\ccache'
CCACHE_INODECACHE: 'true'
CCACHE_SLOPPINESS: 'time_macros'
DEPS_CACHE_DIR: ./dependency_cache
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Restore Dependencies Cache
uses: actions/cache/restore@main
id: restore-dependencies-cache
with:
path: ${{ env.DEPS_CACHE_DIR }}
key: "${{ runner.os }}-${{ env.COMPILER }}-llvm-${{ env.CCACHE_SHA }}"
restore-keys: ${{ runner.os }}-${{ env.COMPILER }}-llvm
- name: Download and unpack dependencies
run: .ci/setup-llvm.sh
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@main
- name: Compile LLVM
shell: pwsh
run: msbuild 3rdparty\llvm\llvm_build.vcxproj /p:SolutionDir="$(pwd)/" /p:Configuration=Release /v:minimal /p:Platform=x64 /p:PreferredToolArchitecture=x64 /p:CLToolPath=${{ env.CCACHE_BIN_DIR }} /p:UseMultiToolTask=true /p:CustomAfterMicrosoftCommonTargets="${{ github.workspace }}\buildfiles\msvc\ci_only.targets"
- name: Pack up build artifacts
run: |
mkdir -p "${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}"
.ci/deploy-llvm.sh
- name: Upload artifacts (7z)
uses: actions/upload-artifact@main
with:
name: LLVM for Windows (MSVC)
path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}
compression-level: 0
if-no-files-found: error
- name: Save Dependencies Cache
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main
with:
path: ${{ env.DEPS_CACHE_DIR }}
key: ${{ steps.restore-dependencies-cache.outputs.cache-primary-key }}

View file

@ -2125,15 +2125,20 @@
<None Include="..\.ci\build-mac.sh" />
<None Include="..\.ci\deploy-linux-legacy.sh" />
<None Include="..\.ci\deploy-linux.sh" />
<None Include="..\.ci\deploy-llvm.sh" />
<None Include="..\.ci\deploy-mac-arm64.sh" />
<None Include="..\.ci\deploy-mac.sh" />
<None Include="..\.ci\deploy-windows.sh" />
<None Include="..\.ci\docker.env" />
<None Include="..\.ci\generate-qt-ts.sh" />
<None Include="..\.ci\get_keys-windows.sh" />
<None Include="..\.ci\github-upload.sh" />
<None Include="..\.ci\install-freebsd.sh" />
<None Include="..\.ci\optimize-mac.sh" />
<None Include="..\.ci\setup-llvm.sh" />
<None Include="..\.ci\setup-windows.sh" />
<None Include="..\.github\workflows\llvm.yml" />
<None Include="..\.github\workflows\qt-ts.yml" />
<None Include="..\.github\workflows\rpcs3.yml" />
<None Include="..\bin\GuiConfigs\Classic (Bright).qss" />
<None Include="..\bin\GuiConfigs\Darker Style by TheMitoSan.qss" />

View file

@ -1893,6 +1893,21 @@
<None Include="..\.github\workflows\rpcs3.yml">
<Filter>CI</Filter>
</None>
<None Include="..\.ci\deploy-llvm.sh">
<Filter>CI</Filter>
</None>
<None Include="..\.ci\generate-qt-ts.sh">
<Filter>CI</Filter>
</None>
<None Include="..\.ci\setup-llvm.sh">
<Filter>CI</Filter>
</None>
<None Include="..\.github\workflows\llvm.yml">
<Filter>CI</Filter>
</None>
<None Include="..\.github\workflows\qt-ts.yml">
<Filter>CI</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Text Include="rpcs3qt\CMakeLists.txt">