-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
37 lines (35 loc) · 1.19 KB
/
action.yml
File metadata and controls
37 lines (35 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Build & Test
description: Builds and runs tests on a .NET codebase
inputs:
dotnet-test-args:
description: .NET test arguments
required: false
default: ""
report-folder:
description: Folder where report files will be generated
required: false
default: report
runs:
using: "composite"
steps:
- name: Build .NET code
run: dotnet build --no-restore --configuration Debug
shell: bash
env:
BUILD_SOURCEBRANCHNAME: ${{ github.ref_name }}
BUILD_BUILDID: ${{ github.run_id }}
- name: Run tests
run: |
dotnet test --no-build --verbosity normal --configuration Debug \
--results-directory "${{ inputs.report-folder }}/TestResults" \
${{ inputs.dotnet-test-args }}
shell: bash
env:
ASPNETCORE_ENVIRONMENT: Development
- name: Generate test report
if: ${{ always() && hashFiles(format('{0}/TestResults/*.cobertura.xml', inputs.report-folder)) != '' }}
run: |
reportgenerator "-reports:${{ inputs.report-folder }}/TestResults/*.cobertura.xml" \
"-targetdir:${{ inputs.report-folder }}" \
"-reporttypes:Cobertura;Html;TextSummary"
shell: bash