-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
75 lines (65 loc) · 2.57 KB
/
azure-pipelines.yml
File metadata and controls
75 lines (65 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# ASP.NET Core 10.0
# Build and test ASP.NET Core projects targeting .NET 10 on Linux.
# https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/dotnet-core
# Pipeline triggers:
# - Disabled: CI is fully covered by GitHub Actions (.github/workflows/dotnet-ci.yml)
# - Kept for educational/reference purposes only
trigger: none
pr: none
# Agent pool configuration (equivalent to GitHub Actions 'runs-on: ubuntu-latest')
pool:
vmImage: "ubuntu-latest"
# Environment variables (equivalent to GitHub Actions 'env:')
variables:
buildConfiguration: "Release"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 # Skip .NET welcome message
DOTNET_NOLOGO: true # Suppress .NET logo in output
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
# Pipeline steps (equivalent to GitHub Actions 'steps:')
steps:
# Checkout repository (equivalent to actions/checkout)
# Azure Pipelines does this implicitly, but making it explicit for clarity
- checkout: self
displayName: "Checkout repository"
# Cache NuGet packages (equivalent to actions/setup-dotnet cache feature)
# Uses packages.lock.json hash as cache key for faster restores
- task: Cache@2
displayName: "Cache NuGet packages"
inputs:
key: 'nuget | "$(Agent.OS)" | **/packages.lock.json'
restoreKeys: |
nuget | "$(Agent.OS)"
path: $(NUGET_PACKAGES)
# Install .NET 10 SDK (equivalent to actions/setup-dotnet)
# performMultiLevelLookup: allows finding other SDK versions if needed
- task: UseDotNet@2
displayName: "Set up .NET 10"
inputs:
version: "10.x"
performMultiLevelLookup: true
# Restore NuGet packages (equivalent to 'dotnet restore')
# feedsToUse: 'select' uses feeds from NuGet.config
- task: DotNetCoreCLI@2
displayName: "Restore dependencies"
inputs:
command: "restore"
projects: "**/*.csproj"
feedsToUse: "select"
# Build the solution (equivalent to 'dotnet build')
# --no-restore: skip restore since we just did it (faster build)
- task: DotNetCoreCLI@2
displayName: "Build projects"
inputs:
command: "build"
projects: "**/*.sln"
arguments: "--configuration $(buildConfiguration) --no-restore"
# Run unit tests (equivalent to 'dotnet test')
# --no-build: use already-built assemblies (faster)
# publishTestResults: automatically publish test results to Azure DevOps (built-in feature)
- task: DotNetCoreCLI@2
displayName: "Run tests"
inputs:
command: "test"
projects: "**/*Tests/*.csproj"
arguments: "--configuration $(buildConfiguration) --no-build"
publishTestResults: true