Skip to content

Commit d4c03c2

Browse files
authored
Add pipeline for Azure DevOps
1 parent ce3fb5e commit d4c03c2

File tree

2 files changed

+87
-1
lines changed

2 files changed

+87
-1
lines changed

.azure-devops/pipelines/build.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Enable the pipeline trigger when any specified branch has changed
2+
trigger:
3+
batch: true
4+
branches:
5+
include:
6+
- main
7+
- features/*
8+
9+
# Enable the pipeline trigger when new PR is created
10+
pr:
11+
autoCancel: true
12+
branches:
13+
include:
14+
- main
15+
16+
pool:
17+
vmImage: ubuntu-latest
18+
19+
jobs:
20+
- job: build
21+
displayName: 'Build'
22+
timeoutInMinutes: 20
23+
24+
steps:
25+
26+
# Build .NET solution
27+
28+
- task: UseDotNet@2
29+
displayName: 'Setup .NET'
30+
inputs:
31+
packageType: sdk
32+
version: '6.x'
33+
installationPath: $(Agent.ToolsDirectory)/dotnet
34+
35+
- task: DotNetCoreCLI@2
36+
displayName: 'Restore dependencies'
37+
inputs:
38+
command: restore
39+
verbosityRestore: Normal
40+
projects: '$(System.DefaultWorkingDirectory)/**/*.csproj'
41+
42+
- task: DotNetCoreCLI@2
43+
displayName: 'Build'
44+
inputs:
45+
command: build
46+
arguments: '--no-restore'
47+
projects: '$(System.DefaultWorkingDirectory)/**/*.csproj'
48+
49+
# Install and configure Logic Apps runtime environment
50+
51+
- task: NodeTool@0
52+
displayName: 'Setup node'
53+
inputs:
54+
versionSpec: '18.x'
55+
56+
- task: FuncToolsInstaller@0
57+
displayName: 'Install Functions core tools'
58+
inputs:
59+
version: 'latest'
60+
61+
- task: CmdLine@2
62+
displayName: 'Check Functions Core tools installation'
63+
inputs:
64+
script: func
65+
66+
- task: Npm@1
67+
displayName: 'Install Azurite'
68+
inputs:
69+
command: 'custom'
70+
customCommand: 'install -g azurite@3.24.0'
71+
72+
- task: CmdLine@2
73+
displayName: 'Start Azurite services'
74+
inputs:
75+
script: 'azurite &'
76+
77+
# Run tests and publish test results to Azure DevOps
78+
79+
- task: DotNetCoreCLI@2
80+
continueOnError: true
81+
displayName: 'Run tests'
82+
inputs:
83+
command: test
84+
arguments: '--no-restore --verbosity normal'
85+
projects: '$(System.DefaultWorkingDirectory)/**/*.Tests.csproj'
86+
publishTestResults: true

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ jobs:
7070
uses: dorny/test-reporter@v1
7171
if: always()
7272
with:
73-
name: Tests
73+
name: Test Results
7474
path: ${{ github.workspace }}/LogicAppUnit.Samples.LogicApps.Tests/TestResults/**.trx
7575
reporter: dotnet-trx

0 commit comments

Comments
 (0)