Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Setup build with Azure DevOps and code coverage with Codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
langsamu committed Jun 12, 2020
1 parent a29b5d1 commit 10492d7
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
10 changes: 8 additions & 2 deletions AvastRecruitmentPrimeMultiplication.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTestProject1", "UnitTes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication1", "WebApplication1\WebApplication1.csproj", "{BBB20ED0-348D-4EBD-9FA7-63F5A2A28799}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary1", "ClassLibrary1\ClassLibrary1.csproj", "{D44BA64C-FA3B-4A8C-AF05-3251988CB5DA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassLibrary1", "ClassLibrary1\ClassLibrary1.csproj", "{D44BA64C-FA3B-4A8C-AF05-3251988CB5DA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{D220589E-4B01-4EEF-947E-37E587A5E993}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{D220589E-4B01-4EEF-947E-37E587A5E993}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5073347F-CDA8-494E-BA86-FC8A7ECEA54B}"
ProjectSection(SolutionItems) = preProject
azure-pipelines.yml = azure-pipelines.yml
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[![Build Status](https://dev.azure.com/langsamu/PrimeMultiplication/_apis/build/status/Build?branchName=master)](https://dev.azure.com/langsamu/PrimeMultiplication/_build?definitionId=20)

[![Codecov](https://codecov.io/gh/langsamu/avast-recruitment-prime-multiplication/branch/master/graph/badge.svg)](https://codecov.io/gh/langsamu/avast-recruitment-prime-multiplication)
47 changes: 47 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
trigger:
- master

pool:
vmImage: windows-latest

variables:
BuildConfiguration: Release
TestProjects: 'UnitTestProject1/UnitTestProject1.csproj'

steps:
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore

- task: DotNetCoreCLI@2
displayName: Install Coverlet
inputs:
command: custom
custom: add
projects: $(TestProjects)
arguments: package coverlet.msbuild

- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
arguments: --configuration $(BuildConfiguration) --no-restore

- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
arguments: --configuration $(BuildConfiguration) --no-build /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=cobertura

- task: PublishCodeCoverageResults@1
displayName: Publish code coverage
inputs:
codeCoverageTool: cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/coverage.cobertura.xml

- task: Bash@3
displayName: Upload to Codecov
inputs:
targetType: inline
script: bash <(curl -s https://codecov.io/bash)

0 comments on commit 10492d7

Please sign in to comment.