141 lines
3.5 KiB
YAML
141 lines
3.5 KiB
YAML
#############################################################################
|
|
## ASP.NET Core ##
|
|
## Build and test ASP.NET Core projects targeting .NET Core. ##
|
|
## Runs tests, creates NuGet packages: ##
|
|
## https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core ##
|
|
#############################################################################
|
|
|
|
# Variables & their default values
|
|
variables:
|
|
buildConfiguration: 'Release'
|
|
|
|
stages:
|
|
- stage: Linux
|
|
jobs:
|
|
|
|
- job: Unit_Tests
|
|
displayName: 'Unit Tests'
|
|
pool:
|
|
vmImage: 'ubuntu-latest'
|
|
steps:
|
|
|
|
- task: UseDotNet@2
|
|
displayName: 'Use .Net Core sdk 5.0.x'
|
|
inputs:
|
|
version: 5.0.x
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'dotnet test'
|
|
inputs:
|
|
command: test
|
|
projects: '**/*.Tests.UnitTests.csproj'
|
|
|
|
|
|
- stage: Windows
|
|
jobs:
|
|
|
|
- job: Unit_Tests
|
|
displayName: 'Unit Tests'
|
|
pool:
|
|
vmImage: 'windows-latest'
|
|
steps:
|
|
|
|
- task: UseDotNet@2
|
|
displayName: 'Use .Net Core sdk 5.0.x'
|
|
inputs:
|
|
version: 5.0.x
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'dotnet test'
|
|
inputs:
|
|
command: test
|
|
projects: '**\*.Tests.UnitTests.csproj'
|
|
|
|
- task: NuGetToolInstaller@1
|
|
displayName: 'Use NuGet Latest'
|
|
|
|
- task: NuGetCommand@2
|
|
displayName: 'Restore NuGet Packages'
|
|
inputs:
|
|
restoreSolution: '*\src\umbraco.sln'
|
|
feedsToUse: config
|
|
|
|
- task: PowerShell@1
|
|
displayName: 'Prepare Build'
|
|
inputs:
|
|
scriptType: inlineScript
|
|
inlineScript: |
|
|
Write-Host "Working folder: $pwd"
|
|
$ubuild = build\build.ps1 -get
|
|
|
|
$ubuild.PrepareBuild("vso")
|
|
|
|
- task: NodeTool@0
|
|
displayName: 'Use Node 11.x'
|
|
inputs:
|
|
versionSpec: 11.x
|
|
|
|
- task: Npm@1
|
|
displayName: 'npm install'
|
|
inputs:
|
|
workingDir: src\Umbraco.Web.UI.Client
|
|
verbose: false
|
|
|
|
- task: gulp@0
|
|
displayName: 'gulp build'
|
|
inputs:
|
|
gulpFile: src\Umbraco.Web.UI.Client\gulpfile.js
|
|
targets: build
|
|
workingDirectory: src\Umbraco.Web.UI.Client
|
|
publishJUnitResults: true
|
|
testResultsFiles: '**\TESTS-*.xml'
|
|
|
|
- task: PowerShell@1
|
|
displayName: 'Prepare Packages'
|
|
inputs:
|
|
scriptType: inlineScript
|
|
inlineScript: |
|
|
Write-Host "Working folder: $pwd"
|
|
$ubuild = build\build.ps1 -get -continue
|
|
|
|
$ubuild.CompileUmbraco()
|
|
$ubuild.PreparePackages()
|
|
|
|
- task: PowerShell@1
|
|
displayName: 'Verify & Package NuGet'
|
|
inputs:
|
|
scriptType: inlineScript
|
|
inlineScript: |
|
|
Write-Host "Working folder: $pwd"
|
|
$ubuild = build\build.ps1 -get -continue
|
|
|
|
$ubuild.VerifyNuGet()
|
|
$ubuild.PackageNuGet()
|
|
|
|
|
|
- job: Integration_Tests
|
|
displayName: 'Integration Tests'
|
|
pool:
|
|
vmImage: 'windows-latest'
|
|
steps:
|
|
|
|
- task: UseDotNet@2
|
|
displayName: 'Use .Net Core sdk 5.0.x'
|
|
inputs:
|
|
version: 5.0.x
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'dotnet build'
|
|
inputs:
|
|
projects: '**\Umbraco.Tests.Integration.csproj'
|
|
|
|
- powershell: 'sqllocaldb start mssqllocaldb'
|
|
displayName: 'Start MSSQL LocalDb'
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'dotnet test'
|
|
inputs:
|
|
command: test
|
|
projects: '**\Umbraco.Tests.Integration.csproj'
|
|
arguments: '--no-build'
|