Skip to content

Commit 536a4fe

Browse files
authored
Merge pull request #316 from nanotaboada/feature/azure-pipeline-linux-dotnet-cli
ci: migrate Azure Pipeline from Windows/MSBuild to Linux/.NET CLI
2 parents 6daa47f + 557b2ad commit 536a4fe

File tree

2 files changed

+70
-37
lines changed

2 files changed

+70
-37
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Dependencies flow from data layer through repositories and services to controlle
108108
"clusterBorder": "#ddd"
109109
}
110110
}}%%
111-
graph LR
111+
graph TB
112112
%% Layer 1: Data
113113
Data[Data]
114114
@@ -152,6 +152,7 @@ graph LR
152152
Controllers --> Program
153153
154154
%% Layer connections
155+
Models --> Mappings
155156
Validators --> Controllers
156157
Mappings --> Services
157158
@@ -351,4 +352,4 @@ Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for de
351352

352353
## Legal
353354

354-
This is a proof-of-concept project intended for educational and demonstration purposes. All trademarks, registered trademarks, service marks, product names, company names, or logos mentioned are the property of their respective owners and are used for identification purposes only.
355+
This project is provided for educational and demonstration purposes and may be used in production environments at your discretion. All referenced trademarks, service marks, product names, company names, and logos are the property of their respective owners and are used solely for identification or illustrative purposes.

azure-pipelines.yml

Lines changed: 67 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,76 @@
1-
# ASP.NET Core (.NET Framework)
2-
# Build and test ASP.NET Core projects targeting the full .NET Framework.
3-
# Add steps that publish symbols, save build artifacts, and more:
4-
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
1+
# ASP.NET Core 8.0
2+
# Build and test ASP.NET Core projects targeting .NET 8 on Linux.
3+
# https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/dotnet-core
54

5+
# Trigger pipeline on commits to master and pull requests (equivalent to GitHub Actions 'on: [push, pull_request]')
66
trigger:
7-
- master
7+
- master
8+
- feature/*
89

10+
pr:
11+
- master
12+
13+
# Agent pool configuration (equivalent to GitHub Actions 'runs-on: ubuntu-latest')
914
pool:
10-
vmImage: 'windows-latest'
15+
vmImage: "ubuntu-latest"
1116

17+
# Environment variables (equivalent to GitHub Actions 'env:')
1218
variables:
13-
solution: '**/*.sln'
14-
buildPlatform: 'Any CPU'
15-
buildConfiguration: 'Release'
19+
buildConfiguration: "Release"
20+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 # Skip .NET welcome message
21+
DOTNET_NOLOGO: true # Suppress .NET logo in output
1622
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
1723

24+
# Pipeline steps (equivalent to GitHub Actions 'steps:')
1825
steps:
19-
- task: NuGetToolInstaller@1
20-
21-
- task: Cache@2
22-
inputs:
23-
key: 'nuget | "$(Agent.OS)" | **/packages.lock.json,!**/bin/**,!**/obj/**'
24-
restoreKeys: |
25-
nuget | "$(Agent.OS)"
26-
path: '$(NUGET_PACKAGES)'
27-
cacheHitVar: 'CACHE_RESTORED'
28-
29-
- task: NuGetCommand@2
30-
condition: ne(variables.CACHE_RESTORED, true)
31-
inputs:
32-
restoreSolution: '$(solution)'
33-
34-
- task: VSBuild@1
35-
inputs:
36-
solution: '$(solution)'
37-
msbuildArgs: '/t:Restore /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
38-
platform: '$(buildPlatform)'
39-
configuration: '$(buildConfiguration)'
40-
41-
- task: VSTest@2
42-
inputs:
43-
platform: '$(buildPlatform)'
44-
configuration: '$(buildConfiguration)'
26+
# Checkout repository (equivalent to actions/checkout@v6)
27+
# Azure Pipelines does this implicitly, but making it explicit for clarity
28+
- checkout: self
29+
displayName: "Checkout repository"
30+
31+
# Cache NuGet packages (equivalent to actions/setup-dotnet cache feature)
32+
# Uses packages.lock.json hash as cache key for faster restores
33+
- task: Cache@2
34+
displayName: "Cache NuGet packages"
35+
inputs:
36+
key: 'nuget | "$(Agent.OS)" | **/packages.lock.json'
37+
restoreKeys: |
38+
nuget | "$(Agent.OS)"
39+
path: $(NUGET_PACKAGES)
40+
41+
# Install .NET 8 SDK (equivalent to actions/setup-dotnet@v5)
42+
# performMultiLevelLookup: allows finding other SDK versions if needed
43+
- task: UseDotNet@2
44+
displayName: "Set up .NET 8"
45+
inputs:
46+
version: "8.x"
47+
performMultiLevelLookup: true
48+
49+
# Restore NuGet packages (equivalent to 'dotnet restore')
50+
# feedsToUse: 'select' uses feeds from NuGet.config
51+
- task: DotNetCoreCLI@2
52+
displayName: "Restore dependencies"
53+
inputs:
54+
command: "restore"
55+
projects: "**/*.csproj"
56+
feedsToUse: "select"
57+
58+
# Build the solution (equivalent to 'dotnet build')
59+
# --no-restore: skip restore since we just did it (faster build)
60+
- task: DotNetCoreCLI@2
61+
displayName: "Build projects"
62+
inputs:
63+
command: "build"
64+
projects: "**/*.sln"
65+
arguments: "--configuration $(buildConfiguration) --no-restore"
66+
67+
# Run unit tests (equivalent to 'dotnet test')
68+
# --no-build: use already-built assemblies (faster)
69+
# publishTestResults: automatically publish test results to Azure DevOps (built-in feature)
70+
- task: DotNetCoreCLI@2
71+
displayName: "Run tests"
72+
inputs:
73+
command: "test"
74+
projects: "**/*Tests/*.csproj"
75+
arguments: "--configuration $(buildConfiguration) --no-build"
76+
publishTestResults: true

0 commit comments

Comments
 (0)