azure-functions-vs-build-sdk/azure-pipelines.yml

60 строки
1.9 KiB
YAML

name: $(Build.SourceBranchName)_$(Build.Reason)_$(devops_buildNumber)
trigger:
- v3.x
- main
pool:
vmImage: 'windows-2019'
variables:
devops_buildNumber: $[counter(format(''), 289)]
steps:
- task: UseDotNet@2
displayName: 'Install dotnet v3.x'
inputs:
packageType: 'sdk'
version: '3.1.x'
performMultiLevelLookup: true
- task: CmdLine@2
inputs:
script: |
powershell Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile '%TEMP%\dotnet-install.ps1'
powershell %TEMP%\dotnet-install.ps1 -Architecture x64 -Version '3.1.301' -InstallDir '%ProgramFiles%\dotnet'
.paket\paket.exe install
packages\FAKE\tools\fake .\build.fsx
env:
FILES_ACCOUNT_KEY: $(FILES_ACCOUNT_KEY)
FILES_ACCOUNT_NAME: $(FILES_ACCOUNT_NAME)
BUILD_VERSION: 1.1.$(devops_buildNumber)
displayName: 'Build'
- task: PowerShell@2
displayName: 'Set dotnet path'
inputs:
targetType: 'inline'
script: |
$infoContent = dotnet --info
$sdkBasePath = $infoContent |
Where-Object {$_ -match 'Base Path:'} |
ForEach-Object {
($_ -replace '\s+Base Path:','').trim()
}
Write-Host "dotnet SDK path: $sdkBasePath"
$dotnetPath = (Get-Item $sdkBasePath).Parent.Parent.FullName
Write-Host "dotnet path: $dotnetPath"
Write-Host "##vso[task.setvariable variable=DotNetPath]$dotnetPath"
- task: DotNetCoreCLI@2
displayName: 'Run End to End tests'
inputs:
command: 'test'
projects: '.\FunctionsSdkE2ETests\FunctionsSdkE2ETests.sln'
arguments: '-v n'
- pwsh: |
Move-Item -Path '$(Build.Repository.LocalPath)\artifacts\Microsoft.NET.Sdk.Functions.*' -Destination '$(Build.ArtifactStagingDirectory)'
displayName: 'Move artifacts'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'