Staging - 9/12/24 #3883
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
# | |
# This workflow will build and run all unit tests. | |
# | |
name: DevHome-CI | |
on: | |
pull_request: | |
push: | |
branches: [ "main", "feature*" ] | |
jobs: | |
build-and-test: | |
strategy: | |
matrix: | |
configuration: [Release, Debug] | |
platform: [x64, x86, arm64] | |
os: [windows-latest] | |
dotnet-version: ['8.0.x'] | |
exclude: | |
- configuration: Debug | |
platform: x64 | |
- configuration: Release | |
platform: x86 | |
- configuration: Debug | |
platform: arm64 | |
runs-on: ${{ matrix.os }} | |
env: | |
MSIX_VERSION: "0.1" | |
SDK_VERSION: "0.1" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
clean: true | |
- name: Setup .NET SDK ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.GPR_READ_TOKEN }} | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v1.1 | |
with: | |
vs-version: '17.5' | |
- name: Download nuget | |
run: | | |
mkdir ".\.nuget" | |
Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -OutFile ".\.nuget\nuget.exe" | |
- name: Find VsDevCmd.bat | |
run: | | |
$VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat | |
if (!$VSDevCmd) { exit 1 } | |
echo "Using VSDevCmd: ${VSDevCmd}" | |
Add-Content $env:GITHUB_ENV "VSDevCmd=$VSDevCmd" | |
- name: Restore nuget packages | |
run: | | |
cmd /c "$env:VSDevCmd" "&" msbuild -t:restore /m /p:Configuration=Release,Platform=${{ matrix.platform }},RestorePackagesConfig=true extensionsdk\\DevHomeSDK.sln | |
cmd /c "$env:VSDevCmd" "&" msbuild -t:restore /m /p:Configuration=Release,Platform=${{ matrix.platform }} DevHome.sln | |
cmd /c ".\.nuget\nuget.exe restore" | |
- name: Build_SDK | |
run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=Release,Platform=${{ matrix.platform }} extensionsdk\\DevHomeSDK.sln | |
- name: Build_DevSetupAgent_x86 | |
if: ${{ matrix.platform != 'arm64' }} | |
run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=${{ matrix.configuration }},Platform=x86 extensions\HyperVExtension\\DevSetupAgent.sln | |
- name: Compress_DevSetupAgent_x86 | |
if: ${{ matrix.platform != 'arm64' }} | |
shell: pwsh | |
run: Compress-Archive -Force -Path extensions\HyperVExtension\src\DevSetupAgent\bin\x86\${{ matrix.configuration }}\net8.0-windows10.0.22621.0\win-x86\* -DestinationPath "extensions\HyperVExtension\src\DevSetupAgent\bin\x86\${{ matrix.configuration }}\DevSetupAgent_x86.zip" | |
- name: Build_DevSetupAgent_arm64 | |
if: ${{ matrix.platform == 'arm64' }} | |
run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=${{ matrix.configuration }},Platform=arm64 extensions\HyperVExtension\\DevSetupAgent.sln | |
- name: Compress_DevSetupAgent_arm64 | |
if: ${{ matrix.platform == 'arm64' }} | |
shell: pwsh | |
run: Compress-Archive -Force -Path extensions\HyperVExtension\src\DevSetupAgent\bin\arm64\${{ matrix.configuration }}\net8.0-windows10.0.22621.0\win-arm64\* -DestinationPath "extensions\HyperVExtension\src\DevSetupAgent\bin\arm64\${{ matrix.configuration }}\DevSetupAgent_arm64.zip" | |
- name: Build_DevHome | |
run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=${{ matrix.configuration }},Platform=${{ matrix.platform }} DevHome.sln | |
- name: Find vstest.console.exe | |
if: ${{ matrix.platform != 'arm64' }} | |
run: | | |
$VSDevTestCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -prerelease -products * -find Common7\IDE\Extensions\TestPlatform\vstest.console.exe | |
if (!$VSDevTestCmd) { exit 1 } | |
echo "Using VSDevTestCmd: ${VSDevTestCmd}" | |
Add-Content $env:GITHUB_ENV "VSDevTestCmd=$VSDevTestCmd" | |
- name: DevHome UnitTests | |
if: ${{ matrix.platform != 'arm64' }} | |
run: cmd /c "$env:VSDevTestCmd" /Platform:${{ matrix.platform }} test\\bin\\${{ matrix.platform }}\\${{ matrix.configuration }}\\net8.0-windows10.0.22621.0\\DevHome.Test.dll | |
- name: Tools UnitTests | |
if: ${{ matrix.platform != 'arm64' }} | |
run: | | |
foreach ($UnitTestPath in (Get-ChildItem "tools\\**\\*UnitTest\\bin\\${{ matrix.platform }}\\${{ matrix.configuration }}\\net8.0-windows10.0.22621.0\\*.UnitTest.dll")) { | |
cmd /c "$env:VSDevTestCmd" /Platform:${{ matrix.platform }} $UnitTestPath.FullName | |
} | |
- name: GitExtension UnitTests | |
if: ${{ matrix.platform != 'arm64' }} | |
run: cmd /c "$env:VSDevTestCmd" /Platform:${{ matrix.platform }} extensions\\GitExtension\\FileExplorerGitIntegration.UnitTest\\bin\\${{ matrix.platform }}\\${{ matrix.configuration }}\\net8.0-windows10.0.22621.0\\FileExplorerGitIntegration.UnitTest.dll |