Skip to content

Collect and report coverage for UnitsNet.Modular #293

Collect and report coverage for UnitsNet.Modular

Collect and report coverage for UnitsNet.Modular #293

Workflow file for this run

name: PR Build
on:
pull_request:
branches:
- master
- 'release/**'
- 'maintenance/**'
paths-ignore:
- '**/*.gitignore'
- '**/*.md'
- '**/*.png'
concurrency:
group: pr-${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build-and-test:
name: PR Build & Test
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
checks: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 1
lfs: true
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v6
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Build, test and pack
shell: pwsh
run: ./Build/build.ps1
- name: Upload test results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results
path: Artifacts/TestResults/*.trx
if-no-files-found: ignore
retention-days: 7
- name: Publish test results
if: ${{ !cancelled() && github.event.pull_request.head.repo.full_name == github.repository && hashFiles('Artifacts/TestResults/*.trx') != '' }}
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: Artifacts/TestResults/*.trx
check_name: PR Test Results
comment_mode: off
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
directory: Artifacts/Coverage
fail_ci_if_error: false
plugins: noop
use_oidc: true
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: artifacts
path: Artifacts/
retention-days: 7