try to fix test reporter for dependabot #76
Workflow file for this run
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: Build & test & publish | |
on: | |
push: | |
branches: [ "main" ] | |
tags: [ "v*" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
# Build packages & run tests | |
build: | |
name: Build & test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 6.x | |
- name: Build project | |
run: ./build.sh -Target All | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: test-results | |
path: test-results | |
if-no-files-found: error | |
retention-days: 7 | |
- name: Upload packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages | |
path: artifacts/*.nupkg | |
if-no-files-found: error | |
retention-days: 7 | |
# Report tests | |
test-report: | |
name: Report tests | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
if: ${{ always() }} | |
permissions: | |
contents: read | |
actions: read | |
checks: write | |
steps: | |
- name: Download test results | |
uses: actions/download-artifact@v4 | |
with: | |
name: test-results | |
path: test-results/ | |
- name: Report tests | |
uses: dorny/test-reporter@v1 | |
if: ${{ always() }} | |
with: | |
name: .NET Tests | |
path: ./test-results/**/*.trx | |
reporter: dotnet-trx | |
# Report coverage | |
coverage-report: | |
name: Report coverage | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download test results | |
uses: actions/download-artifact@v4 | |
with: | |
name: test-results | |
path: test-results/ | |
- name: Upload code coverage report | |
uses: codecov/codecov-action@v3 | |
if: ${{ always() }} | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./test-results/ | |
# Publish packages to nuget.org | |
publish-to-nuget-org: | |
name: Publish to NuGet.org | |
needs: [ build ] | |
environment: NuGet.org | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 6.x | |
- name: Download packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
path: packages/ | |
- name: Publish packages | |
run: dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} packages/*.nupkg |