Created
September 23, 2020 19:21
-
-
Save kzu/08462bd0e4091037307b26bf144909ed to your computer and use it in GitHub Desktop.
Visual Studio Preview in CI
This file contains hidden or 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
pool: | |
vmImage: 'windows-2019' | |
steps: | |
- checkout: self | |
- task: UseDotNet@2 | |
inputs: | |
packageType: sdk | |
version: 3.1.x | |
performMultiLevelLookup: true | |
- script: dotnet tool update -g dotnet-vs | |
displayName: dotnet tool update -g dotnet-vs | |
- pwsh: echo "##vso[task.setvariable variable=MSB]$(vs where preview --prop=InstallationPath)" | |
- script: vs install preview --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools | |
displayName: vs install preview | |
condition: eq(variables['MSB'], '') | |
- pwsh: echo "##vso[task.prependpath]$(vs where preview --prop=InstallationPath)\MSBuild\Current\Bin" | |
displayName: prepend MSBuild to %PATH% | |
- script: msbuild -r | |
displayName: msbuild -r | |
- script: msbuild -t:test | |
displayName: msbuild -t:test |
This file contains hidden or 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: build | |
on: push | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 3.1.x | |
- run: dotnet tool update -g dotnet-vs | |
- run: echo "::set-env name=MSB::$(vs where preview --prop=InstallationPath)" | |
- run: vs install preview --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools | |
if: env.MSB == '' | |
- run: echo "::add-path::$(vs where preview --prop=InstallationPath)\MSBuild\Current\Bin" | |
- run: msbuild -r | |
- run: msbuild -t:test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment