Skip to content

Update xunit runner #195

Update xunit runner

Update xunit runner #195

Workflow file for this run

name: everything
on: [ push, pull_request ]
jobs:
test:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
framework: [ 'net7.0', 'net6.0' ]
include:
- os: windows-latest
framework: net48
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
- name: Run tests (${{ matrix.framework }})
run: dotnet test --configuration Release --framework ${{ matrix.framework }} --results-directory test-results --settings test.runsettings
- name: Publish coverage
uses: codecov/codecov-action@v3
with:
file: test-results/*/coverage.opencover.xml
package:
needs: test
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
- name: Create packages (w/o version suffix)
run: dotnet pack --configuration Release --include-symbols --property:PackageOutputPath=${{ runner.temp }}\pkg
if: startsWith(github.ref, 'refs/tags/v') == true
- name: Create packages (w/ version suffix)
run: dotnet pack --configuration Release --include-symbols --version-suffix preview.${{ github.run_number }} --property:PackageOutputPath=${{ runner.temp }}\pkg
if: startsWith(github.ref, 'refs/tags/v') != true
- name: Upload packages
uses: actions/upload-artifact@v3
with:
name: packages
path: ${{ runner.temp }}\pkg
if: github.event_name == 'push'
prerelease:
needs: package
runs-on: windows-latest
steps:
- name: Download packages
uses: actions/download-artifact@v3
with:
name: packages
- name: Publish packages
run: dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
if: github.ref == 'refs/heads/main'
release:
needs: package
runs-on: windows-latest
steps:
- name: Download packages
uses: actions/download-artifact@v3
with:
name: packages
- name: Publish packages
run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --skip-duplicate --source nuget.org
if: startsWith(github.ref, 'refs/tags/v') == true