Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 23 additions & 32 deletions .github/workflows/build-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,63 @@ on:
push:
branches:
- master

env:
DOTNET_VERSION: '6.0.x'
jobs:
build-and-test-windows:
name: Build And Test
runs-on: windows-2019

build-and-test:
name: Build And Test ${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.101
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore nHapi
- name: Restore nHapi (Windows)
if: matrix.os == 'windows-latest'
run: |
dotnet restore nHapi.sln --configfile build\.nuget\NuGet.config

- name: Restore nHapi (Non-Windows)
if: matrix.os != 'windows-latest'
run: |
dotnet restore nHapi.sln --configfile build/.nuget/NuGet.config

- name: Build nHapi
run: |
dotnet build nHapi.sln -c Release --no-restore

- name: Run tests for all target frameworks
- name: Run tests for all target frameworks (Windows)
if: matrix.os == 'windows-latest'
run: |
dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj -r TestResults -c Release -f net461 --no-restore --no-build
dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj -r TestResults -c Release -f net6.0--no-restore --no-build
dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests\NHapi.NUnit.SourceGeneration\NHapi.NUnit.SourceGeneration.csproj -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests\NHapi.NUnit\NHapi.NUnit.csproj -r TestResults -c Release -f net461 --no-restore --no-build
dotnet test tests\NHapi.NUnit\NHapi.NUnit.csproj -r TestResults -c Release -f net6.0 --no-restore --no-build

build-and-test-linux:
name: Build And Test Linux
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.101

- name: Restore nHapi
run: |
dotnet restore nHapi.sln --configfile build/.nuget/NuGet.config

- name: Build nHapi
run: |
dotnet build nHapi.sln -c Release --no-restore

- name: Run tests for all target frameworks
- name: Run tests for all target frameworks (Non-Windows)
if: matrix.os != 'windows-latest'
run: |
dotnet test tests/NHapi.Base.NUnit/NHapi.Base.NUnit.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests/NHapi.NUnit.SourceGeneration/NHapi.NUnit.SourceGeneration.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests/NHapi.NUnit/NHapi.NUnit.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f net6.0 --no-restore --no-build

- name: Upload Code Coverage Report
if: always()
if: always() && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v2
with:
name: coverage-reports
path: |
TestResults/

publish-coverage-results:
needs: build-and-test-linux
needs: build-and-test
name: Publish Code Coverage Results
runs-on: ubuntu-latest
# the build-and-test job might be skipped, we don't need to run this job then
Expand Down
76 changes: 34 additions & 42 deletions .github/workflows/receive-pr.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,68 @@
name: Receive Pull Request

on: [pull_request]

env:
DOTNET_VERSION: '6.0.x'
jobs:
build-and-test-windows:
name: Build And Test
runs-on: windows-2019

build-and-test:
name: Build And Test ${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.101
- name: Restore nHapi
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore nHapi (Windows)
if: matrix.os == 'windows-latest'
run: |
dotnet restore nHapi.sln --configfile build\.nuget\NuGet.config

- name: Restore nHapi (Non-Windows)
if: matrix.os != 'windows-latest'
run: |
dotnet restore nHapi.sln --configfile build/.nuget/NuGet.config

- name: Build nHapi
run: |
dotnet build nHapi.sln -c Release --no-restore

- name: Run tests for all target frameworks
- name: Run tests for all target frameworks (Windows)
if: matrix.os == 'windows-latest'
run: |
dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj --logger "trx;LogFilePrefix=TestResults" -r TestResults -c Release -f net461 --no-restore --no-build
dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj --logger "trx;LogFilePrefix=TestResults" -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests\NHapi.NUnit.SourceGeneration\NHapi.NUnit.SourceGeneration.csproj --logger "trx;LogFilePrefix=TestResults" -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests\NHapi.NUnit\NHapi.NUnit.csproj --logger "trx;LogFilePrefix=TestResults" -r TestResults -c Release -f net461 --no-restore --no-build
dotnet test tests\NHapi.NUnit\NHapi.NUnit.csproj --logger "trx;LogFilePrefix=TestResults" -r TestResults -c Release -f net6.0 --no-restore --no-build

- name: Run tests for all target frameworks (Non-Windows)
if: matrix.os != 'windows-latest'
run: |
dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj --logger "trx;LogFilePrefix=TestResults" -r TestResults -c Release -f net461 --no-restore --no-build
dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj --logger "trx;LogFilePrefix=TestResults" -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests\NHapi.NUnit.SourceGeneration\NHapi.NUnit.SourceGeneration.csproj --logger "trx;LogFilePrefix=TestResults" -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests\NHapi.NUnit\NHapi.NUnit.csproj --logger "trx;LogFilePrefix=TestResults" -r TestResults -c Release -f net461 --no-restore --no-build
dotnet test tests\NHapi.NUnit\NHapi.NUnit.csproj --logger "trx;LogFilePrefix=TestResults" -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests/NHapi.Base.NUnit/NHapi.Base.NUnit.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests/NHapi.NUnit.SourceGeneration/NHapi.NUnit.SourceGeneration.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests/NHapi.NUnit/NHapi.NUnit.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f net6.0 --no-restore --no-build

- name: Convert trx to junit
if: ${{ success() || failure() }}
if: (success() || failure()) && matrix.os == 'windows-latest'
run: |
dotnet tool install -g trx2junit
trx2junit TestResults/*.trx

- name: Upload Unit Test Results
if: always()
if: always() && matrix.os == 'windows-latest'
uses: actions/upload-artifact@v2
with:
name: unit-test-results
path: TestResults\TestResults*.xml

build-and-test-linux:
name: Build And Test Linux
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.101

- name: Restore nHapi
run: |
dotnet restore nHapi.sln --configfile build/.nuget/NuGet.config

- name: Build nHapi
run: |
dotnet build nHapi.sln -c Release --no-restore

- name: Run tests for all target frameworks
run: |
dotnet test tests/NHapi.Base.NUnit/NHapi.Base.NUnit.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests/NHapi.NUnit.SourceGeneration/NHapi.NUnit.SourceGeneration.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f net6.0 --no-restore --no-build
dotnet test tests/NHapi.NUnit/NHapi.NUnit.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f net6.0 --no-restore --no-build

- name: Upload Code Coverage Report
if: always()
if: always() && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v2
with:
name: coverage-reports
Expand Down