Skip to content

Update buildpipeline.yml for Azure Pipelines #20

Update buildpipeline.yml for Azure Pipelines

Update buildpipeline.yml for Azure Pipelines #20

name: build and test dotnet
on:
push:
pull_request:
branches: [ master ]
paths:
- '**.cs'
- '**.csproj'
env:
DOTNET_VERSION: '6.0' # The .NET SDK version to use
jobs:
build:
name: build-and-test
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --logger "trx;LogFileName=test-results.trx" --collect "Code Coverage"
- name: Create Test Report
uses: dorny/test-reporter@v1
with:
name: Unit Tests # Name of the check run which will be created
path: '**/*.trx' # Path to test results (inside artifact .zip)
reporter: dotnet-trx # Format of test results