Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Visual Studio Preview in CI
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
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