Merge pull request #22 from Maksasj/dependabot/nuget/Microsoft.Graph-β¦ #35
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
name: Unit Test With Coverage | |
on: | |
push: | |
branches: [ "master", "dev" ] | |
pull_request: | |
branches: [ "master", "dev" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.303 | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
run: dotnet test -p:CollectCoverage=true -p:CoverletOutput=TestResults/ -p:CoverletOutputFormat=opencover --no-build --verbosity normal Hoo.UnitTests/ | |
- name: Create Test Coverage Badge | |
uses: simon-k/dotnet-code-coverage-badge@v1.0.0 | |
id: create_coverage_badge | |
with: | |
label: Unit Test Coverage | |
color: blue | |
path: Hoo.UnitTests/TestResults/coverage.opencover.xml | |
gist-filename: hoo-code-coverage.json | |
gist-id: 88c718518ac856fce876e5738695db50 | |
gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }} | |
- name: Print code coverage | |
run: echo "Code coverage percentage ${{steps.create_coverage_badge.outputs.percentage}}%" |