Add Visual Studio project template #1518
Workflow file for this run
This file contains hidden or 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: Build | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - .github/** | |
| - src/** | |
| - tests/** | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - .github/** | |
| - src/** | |
| - tests/** | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore ./src/Shark.Fido2.slnx | |
| - name: Build | |
| run: dotnet build ./src/Shark.Fido2.slnx --configuration Release --no-restore | |
| - name: Test | |
| run: dotnet test ./src/Shark.Fido2.slnx --filter FullyQualifiedName\!~Shark.Fido2.Core.Performance.Tests --collect:"XPlat Code Coverage;Format=json,lcov,cobertura" --results-directory "TestResults" --configuration Release --no-build --verbosity normal | |
| - name: Add .NET global tools to PATH | |
| run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH | |
| - name: Install ReportGenerator | |
| run: dotnet tool install -g dotnet-reportgenerator-globaltool | |
| - name: Generate Code Coverage Report (HTML & Cobertura XML) | |
| run: reportgenerator "-reports:TestResults/**/coverage.cobertura.xml" "-targetdir:coverage-report" "-reporttypes:Html;Cobertura;TextSummary" | |
| - name: Upload Test Results as Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: TestResults/ | |
| - name: Upload Code Coverage Report (HTML) as Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: code-coverage-html-report | |
| path: coverage-report/ | |
| - name: Append Coverage Summary to GitHub Job Summary | |
| run: | | |
| echo "### Code Coverage Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| grep -E 'Line coverage|Branch coverage' coverage-report/Summary.txt >> $GITHUB_STEP_SUMMARY |