Created
September 19, 2022 14:42
-
-
Save bogdanbujdea/38ee02142d2db62d0c894999fb56cf37 to your computer and use it in GitHub Desktop.
NDepend task for running static code analysis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ASP.NET | |
# Build and test ASP.NET projects. | |
# Add steps that publish symbols, save build artifacts, deploy, and more: | |
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4 | |
trigger: | |
- main | |
pool: | |
vmImage: 'windows-latest' | |
variables: | |
solution: '**/*.sln' | |
buildPlatform: 'Any CPU' | |
buildConfiguration: 'Release' | |
stages: | |
- stage: build | |
jobs: | |
- job: build | |
steps: | |
- task: DotNetCoreCLI@2 | |
inputs: | |
command: 'build' | |
- task: DotNetCoreCLI@2 | |
inputs: | |
command: 'publish' | |
publishWebProjects: true | |
arguments: '-o $(build.artifactStagingDirectory)' | |
zipAfterPublish: false | |
- task: PublishPipelineArtifact@1 | |
inputs: | |
targetPath: $(build.artifactStagingDirectory) | |
artifact: 'drop' | |
publishLocation: 'pipeline' | |
- task: NDependTask@1 | |
inputs: | |
BinariesOutput: '$(build.artifactStagingDirectory)' | |
env: | |
SYSTEM_ACCESSTOKEN: $(System.AccessToken) | |
- stage: test | |
jobs: | |
- job: test | |
steps: | |
- task: DotNetCoreCLI@2 | |
inputs: | |
command: 'test' | |
projects: '**/*[Tt]est*/*.csproj' | |
publishTestResults: true | |
arguments: '--configuration $(buildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura' | |
- task: PublishCodeCoverageResults@1 | |
inputs: | |
codeCoverageTool: 'Cobertura' | |
summaryFileLocation: '**/*coverage.cobertura.xml' | |
- stage: deploy_app | |
jobs: | |
- job: deploy | |
steps: | |
- task: DownloadPipelineArtifact@2 | |
inputs: | |
buildType: 'current' | |
artifactName: 'drop' | |
targetPath: '$(Pipeline.Workspace)/drop' | |
- task: AzureWebApp@1 | |
inputs: | |
azureSubscription: 'Visual Studio Enterprise MVP(97fbe79d-f21c-4cd0-b87f-8bd8df413e0a)' | |
appType: 'webAppLinux' | |
appName: 'TodoistApp' | |
package: '$(Pipeline.Workspace)/drop' | |
runtimeStack: 'DOTNETCORE|6.0' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment