Skip to content

ci: add test results and coverage reporting to PR comments #177

ci: add test results and coverage reporting to PR comments

ci: add test results and coverage reporting to PR comments #177

Workflow file for this run

name: CI Builds
permissions:
contents: read
pull-requests: write
on:
pull_request:
jobs:
release:
name: CI Build
strategy:
matrix:
kind: ['linux', 'windows', 'macOS']
include:
- kind: linux
os: ubuntu-latest
target: linux-x64
- kind: windows
os: windows-latest
target: win-x64
- kind: macOS
os: macos-latest
target: osx-x64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup dotnet
uses: actions/setup-dotnet@v5.2.0
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal --logger trx --collect:"XPlat Code Coverage"
- name: Merge coverage reports
if: ${{ always() && matrix.os == 'ubuntu-latest' }}
uses: danielpalme/ReportGenerator-GitHub-Action@5
with:
reports: tests/**/coverage.cobertura.xml
targetdir: coverage
reporttypes: Cobertura
- name: Generate test report
uses: bibipkins/dotnet-test-reporter@v1.6.1
if: ${{ always() && matrix.os == 'ubuntu-latest' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-title: "Test Results"
results-path: tests/**/*.trx
coverage-path: coverage/Cobertura.xml
coverage-type: cobertura
coverage-threshold: 70
- name: Publish
run: dotnet publish src/SharpFM/SharpFM.csproj --runtime "${{ matrix.target }}" -c Debug