Try running .NET framework tests using dotnet vstest #83
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 | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
6.0.x | |
7.0.x | |
8.0.x | |
#- name: Setup .NET Framework | |
# run: | | |
# choco install microsoft-build-tools | |
# choco install dotnet4.6.1 # Ensure that older frameworks are available | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Test .NET | |
env: | |
SECRET_BASE_URL: ${{ secrets.SECRET_BASE_URL }} | |
SECRET_API_KEY: ${{ secrets.SECRET_API_KEY }} | |
SECRET_LOG_ID: ${{ secrets.SECRET_LOG_ID }} | |
SECRET_HEARTBEAT_ID: ${{ secrets.SECRET_HEARTBEAT_ID }} | |
run: dotnet test --no-restore --verbosity normal | |
- name: Test .NET Framework | |
env: | |
SECRET_BASE_URL: ${{ secrets.SECRET_BASE_URL }} | |
SECRET_API_KEY: ${{ secrets.SECRET_API_KEY }} | |
SECRET_LOG_ID: ${{ secrets.SECRET_LOG_ID }} | |
SECRET_HEARTBEAT_ID: ${{ secrets.SECRET_HEARTBEAT_ID }} | |
run: | | |
dotnet vstest test/Elmah.Io.Client.Test/bin/Release/net45/Elmah.Io.Client.Test.dll | |
dotnet vstest test/Elmah.Io.Client.Test/bin/Release/net46/Elmah.Io.Client.Test.dll | |
dotnet vstest test/Elmah.Io.Client.Test/bin/Release/net461/Elmah.Io.Client.Test.dll | |
- name: Pack | |
run: dotnet pack --configuration Release src/Elmah.Io.Client/Elmah.Io.Client.csproj /p:Version=5.2.${{ github.run_number }}-pre | |
#- name: Push | |
# run: dotnet nuget push src/Elmah.Io.Client/bin/Release/Elmah.Io.Client.5.2.${{ github.run_number }}-pre.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | |
# if: ${{ github.event_name == 'push' }} |