Bump NUnit from 4.2.2 to 4.3.0 (#64) #229
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: | |
global-json-file: global.json | |
- 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: | |
- 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: Report tests | |
uses: dorny/test-reporter@v1 | |
if: ${{ always() }} | |
with: | |
name: .NET Tests | |
path: ./test-results/**/*.trx | |
reporter: dotnet-trx | |
- name: Upload code coverage report | |
uses: codecov/codecov-action@v5 | |
if: ${{ always() }} | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./test-results/ | |
fail_ci_if_error: true | |
# 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: | |
global-json-file: global.json | |
- 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 |