Add missing XML documentation comments (#12) #20
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: .NET Core | |
on: | |
push: | |
branches: | |
- develop | |
- beta | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- develop | |
- beta | |
workflow_dispatch: | |
jobs: | |
build: | |
name: π¨ Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: π¨βπ» Check-out code | |
uses: actions/checkout@v4 | |
- name: π¨βπ§ Setup .NET Core SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: π Enable problem matchers | |
run: echo "::add-matcher::.github/matchers/dotnet.json" | |
# - name: Install DocFX | |
# if: github.ref == 'refs/heads/develop' | |
# run: choco install docfx -y | |
- name: π¨ Build | |
run: | | |
dotnet build src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj --configuration Release | |
dotnet build tests/Titanium.Web.Proxy.UnitTests/Titanium.Web.Proxy.UnitTests.csproj --configuration Release | |
dotnet build tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj --property WarningLevel=0 | |
- name: π§ͺ Test | |
shell: pwsh | |
run: | | |
Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value '## π§ͺ Unit Tests' | |
dotnet test tests/Titanium.Web.Proxy.UnitTests/Titanium.Web.Proxy.UnitTests.csproj --configuration Release -v minimal --no-build --logger GitHubActions '/p:CollectCoverage=true;CoverletOutputFormat="json,lcov,cobertura";MergeWith=${{github.workspace}}/coverage.json;CoverletOutput=${{github.workspace}}/coverage' -- RunConfiguration.CollectSourceInformation=true | |
dotnet test tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj -v minimal --no-build --logger GitHubActions '/p:CollectCoverage=true;CoverletOutputFormat="json,lcov,cobertura";MergeWith=${{github.workspace}}/coverage.json;CoverletOutput=${{github.workspace}}/coverage' -- RunConfiguration.CollectSourceInformation=true | |
- name: π Code Coverage report | |
if: always() | |
shell: pwsh | |
run: | | |
dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.* | |
reportgenerator -reports:${{github.workspace}}/coverage.cobertura.xml -targetdir:${{github.workspace}}/report -reporttypes:MarkdownSummaryGithub -filefilters:-*.g.cs "-classfilters:-Titanium.Web.Proxy.Network.WinAuth.*" -verbosity:Warning | |
$report = Get-Content ${{github.workspace}}/report/SummaryGithub.md -Raw | |
$report = $report.Replace('# Summary', '## π Code Coverage').Replace('## Coverage', '### π Code Coverage details') | |
Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value $report | |
env: | |
REPORTGENERATOR_LICENSE: ${{ secrets.REPORTGENERATOR_LICENSE }} | |
- name: π¦ Upload Code Coverage report | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: ${{github.workspace}}\report | |
if-no-files-found: ignore | |
retention-days: 5 | |
# - name: Update Documentation | |
# if: github.ref == 'refs/heads/develop' | |
# run: docfx .github/docfx.json | |
# - name: Publish Documentation | |
# if: github.ref == 'refs/heads/develop' | |
# uses: EndBug/add-and-commit@v9 | |
# with: | |
# default_author: github_actions | |
# message: Update documentation | |
# committer_name: GitHub Actions | |
# committer_email: [email protected] | |
publish: | |
name: π Publish | |
needs: build | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: π¨βπ» Check-out code | |
uses: actions/checkout@v4 | |
- name: π¨βπ§ Setup .NET Core SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: π Enable problem matchers | |
run: echo "::add-matcher::.github/matchers/dotnet.json" | |
- name: π¦ Package | |
shell: pwsh | |
run: | | |
dotnet pack src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj --configuration Release -p:Version=$("${{ github.ref_name }}".Substring(1)) | |
- name: π Publish | |
run: | | |
dotnet nuget push **\*.nupkg -s "nuget" -k $NUGET_AUTH_TOKEN | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }} | |
- name: π Publish summary | |
shell: pwsh | |
run: | | |
$version = $("${{ github.ref_name }}".Substring(1)); | |
Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value '## π Published' | |
Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- Code [tag ${{ github.ref_name }}](https://github.com/svrooij/titanium-web-proxy/tree/${{ github.ref_name }}) has been published to NuGet." | |
Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- Nuget [$version](https://www.nuget.org/packages/Unobtanium.Web.Proxy/$version) has been published to NuGet." | |