Skip to content

feat: Add Chocolatey and Homebrew packaging support (#44) #176

feat: Add Chocolatey and Homebrew packaging support (#44)

feat: Add Chocolatey and Homebrew packaging support (#44) #176

Workflow file for this run

name: Code Coverage
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
code-coverage:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install ReportGenerator
run: dotnet tool install -g dotnet-reportgenerator-globaltool
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore /p:TreatWarningsAsErrors=true
- name: Test with coverage
run: dotnet test --no-build --verbosity normal
- name: Install coverlet
run: dotnet tool install --global coverlet.console
- name: Generate coverage data
run: |
mkdir -p TestResults
coverlet ./tests/DotNetApiDiff.Tests/bin/Debug/net8.0/DotNetApiDiff.Tests.dll --target "dotnet" --targetargs "test ./tests/DotNetApiDiff.Tests/DotNetApiDiff.Tests.csproj --no-build" --format cobertura --output ./TestResults/coverage.cobertura.xml
- name: Generate coverage report
run: reportgenerator "-reports:./TestResults/coverage.cobertura.xml" "-targetdir:./CodeCoverage" "-reporttypes:HtmlInline_AzurePipelines;Cobertura"
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: ./CodeCoverage
- name: Setup Pages
uses: actions/configure-pages@v4
if: github.ref == 'refs/heads/main'
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v3
if: github.ref == 'refs/heads/main'
with:
path: ./CodeCoverage
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
if: github.ref == 'refs/heads/main'