Repository navigation
42 lines (38 loc) · 1.71 KB
/
Copy pathAlgorithms_Scenario05.yml
File metadata and controls
42 lines (38 loc) · 1.71 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
38
39
40
41
42
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: "Algorithms Scenario 05"
on:
push:
branches: [ "main" ]
paths: [ 'samples/Algorithms/src/**', '.github/workflows/Algorithms_Scenario05.yml' ]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./samples/Algorithms/src/Algorithms.Console
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 8.0.x
- name: Publish
run: dotnet publish -r linux-x64 -c Release /p:AotMsCodeCoverageInstrumentation="true"
- name: Install dotnet-coverage
run: dotnet tool install -g dotnet-coverage
- name: Run
run: dotnet-coverage collect --output $GITHUB_WORKSPACE/report.cobertura.xml --output-format cobertura ./bin/Release/net8.0/linux-x64/publish/Algorithms.Console
- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@d3ebf1f760f7d8ab92cc44d9bcfee7ad73722a31 # 5.5.11
with:
reports: '${{ github.workspace }}/report.cobertura.xml'
targetdir: '${{ github.workspace }}/coveragereport'
reporttypes: 'MarkdownSummaryGithub'
- name: Upload coverage into summary
run: cat $GITHUB_WORKSPACE/coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
- name: Archive code coverage results
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: code-coverage-report
path: ${{ github.workspace }}/report.cobertura.xml