Skip to content

Updates Docker versioning and adds alpha builds #22

Updates Docker versioning and adds alpha builds

Updates Docker versioning and adds alpha builds #22

name: Unit Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
- v-next
permissions:
contents: read
checks: write
pull-requests: write
env:
DEFAULT_DOTNET_VERSION: "8.0.x"
jobs:
test:
runs-on: ubuntu-latest
name: Run Unit Tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
${{ env.DEFAULT_DOTNET_VERSION }}
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build solution
run: dotnet build --no-restore --configuration Release
- name: Run unit tests
run: dotnet test --no-build --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults --logger trx --logger "console;verbosity=detailed"
- name: Publish Test Results
uses: dorny/test-reporter@v1
if: always()
with:
name: .NET Tests
path: ./TestResults/**/*.trx
reporter: dotnet-trx
fail-on-error: true
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
if: always()
with:
filename: ./TestResults/**/coverage.cobertura.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '60 80'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ github.run_number }}
path: ./TestResults
- name: Upload coverage reports
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-reports-${{ github.run_number }}
path: ./TestResults/**/coverage.cobertura.xml