[update]24-07-27-23:00 #627
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MSBuild | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
env: | |
# Path to the solution file relative to the root of the project. | |
SOLUTION_FILE_PATH: . | |
# Configuration type to build. | |
# You can convert this to a build matrix if you need coverage of multiple configuration types. | |
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
BUILD_CONFIGURATION: Release | |
BUILD_PLATFORM: x64 | |
VCPKG_DEFAULT_TRIPLET: x64-windows-static | |
VCPKG_INSTALL_PATH: C:\vcpkg | |
VCPKG_BINARY_SOURCES: clear;files,C:\vcpkg_caches,readwrite | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Workaround test | |
if: runner.os == 'Windows' | |
run: | | |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" | |
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" | |
$componentsToRemove= @( | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.ARM" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.ARM.Spectre" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.ARM64" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.ARM64.Spectre" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.x86.x64" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.x86.x64.Spectre" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.ATL" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.ATL.Spectre" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.ATL.ARM" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.ATL.ARM.Spectre" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.ATL.ARM64" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.ATL.ARM64.Spectre" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.MFC" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.MFC.Spectre" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.MFC.ARM" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.MFC.ARM.Spectre" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.MFC.ARM64" | |
"Microsoft.VisualStudio.Component.VC.14.33.17.3.MFC.ARM64.Spectre" | |
) | |
[string]$workloadArgs = $componentsToRemove | ForEach-Object {" --remove " + $_} | |
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache') | |
# should be run twice | |
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden | |
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Restore NuGet packages | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: nuget restore ${{env.SOLUTION_FILE_PATH}} | |
- name: Install vcpkg | |
run: | |
cd "${{ env.VCPKG_INSTALL_PATH }}" && | |
git pull && | |
.\bootstrap-vcpkg.bat | |
- name: Check vcpkg | |
run: dir "${{ env.VCPKG_INSTALL_PATH }}" | |
- name: vcpkg integrate | |
run: cd "${{ env.VCPKG_INSTALL_PATH }}" && vcpkg.exe integrate install | |
- name: Restore vcpkg caches | |
uses: actions/[email protected] | |
with: | |
path: C:\vcpkg_caches | |
key: vcpkg-${{hashFiles('./vcpkg.json')}} | |
restore-keys: | | |
vcpkg-${{hashFiles('./vcpkg.json')}} | |
- name: Build | |
# working-directory: ${{env.GITHUB_WORKSPACE}} | |
# Add additional options to the MSBuild command line here (like platform or verbosity level). | |
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference | |
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} /p:Platform="${{env.BUILD_PLATFORM}}" | |
- name: Upload a Build Artifact | |
uses: actions/[email protected] | |
with: | |
name: UmaUmaChecker-${{env.BUILD_PLATFORM}} | |
path: ${{env.SOLUTION_FILE_PATH}}/${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} |