55 - master
66
77jobs :
8- build-and-test :
8+ build-and-test-windows :
99 name : Build And Test
1010 runs-on : windows-2019
1111
@@ -15,34 +15,89 @@ jobs:
1515 - name : Setup .NET Core
1616 uses : actions/setup-dotnet@v1
1717 with :
18- dotnet-version : 3.1.301
18+ dotnet-version : 3.1.405
19+
1920 - name : Restore nHapi
2021 run : |
2122 dotnet restore nHapi.sln --configfile build\.nuget\NuGet.config
2223 dotnet restore Hl7Models.sln --configfile build\.nuget\NuGet.config
24+
2325 - name : Build nHapi
2426 run : |
2527 dotnet build nHapi.sln -c Release --no-restore
2628 dotnet build Hl7Models.sln -c Release --no-restore
29+
2730 - name : Run tests for all target frameworks
2831 run : |
29- dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f net461 --no-restore --no-build
30- dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f netcoreapp3.1 --no-restore --no-build
31- dotnet test tests\NHapi.NUnit.SourceGeneration\NHapi.NUnit.SourceGeneration.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f net461 --no-restore --no-build
32- dotnet test tests\NHapi.NUnit.SourceGeneration\NHapi.NUnit.SourceGeneration.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f netcoreapp3.1 --no-restore --no-build
33- dotnet test tests\NHapi.NUnit\NHapi.NUnit.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f net461 --no-restore --no-build
34- dotnet test tests\NHapi.NUnit\NHapi.NUnit.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f netcoreapp3.1 --no-restore --no-build
32+ dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj -r TestResults -c Release -f net461 --no-restore --no-build
33+ dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj -r TestResults -c Release -f netcoreapp3.1 --no-restore --no-build
34+ dotnet test tests\NHapi.NUnit.SourceGeneration\NHapi.NUnit.SourceGeneration.csproj -r TestResults -c Release -f net461 --no-restore --no-build
35+ dotnet test tests\NHapi.NUnit.SourceGeneration\NHapi.NUnit.SourceGeneration.csproj -r TestResults -c Release -f netcoreapp3.1 --no-restore --no-build
36+ dotnet test tests\NHapi.NUnit\NHapi.NUnit.csproj -r TestResults -c Release -f net461 --no-restore --no-build
37+ dotnet test tests\NHapi.NUnit\NHapi.NUnit.csproj -r TestResults -c Release -f netcoreapp3.1 --no-restore --no-build
38+
39+ build-and-test-linux :
40+ name : Build And Test Linux
41+ runs-on : ubuntu-latest
42+
43+ steps :
44+ - uses : actions/checkout@v2
45+
46+ - name : Setup .NET Core
47+ uses : actions/setup-dotnet@v1
48+ with :
49+ dotnet-version : 3.1.405
50+
51+ - name : Restore nHapi
52+ run : |
53+ dotnet restore nHapi.sln --configfile build/.nuget/NuGet.config
54+ dotnet restore Hl7Models.sln --configfile build/.nuget/NuGet.config
55+
56+ - name : Build nHapi
57+ run : |
58+ dotnet build nHapi.sln -c Release --no-restore
59+ dotnet build Hl7Models.sln -c Release --no-restore
60+
61+ - name : Run tests for all target frameworks
62+ run : |
63+ dotnet test tests/NHapi.Base.NUnit/NHapi.Base.NUnit.csproj -r TestResults -c Release -f net461 --no-restore --no-build
64+ dotnet test tests/NHapi.Base.NUnit/NHapi.Base.NUnit.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f netcoreapp3.1 --no-restore --no-build
65+ dotnet test tests/NHapi.NUnit.SourceGeneration/NHapi.NUnit.SourceGeneration.csproj -r TestResults -c Release -f net461 --no-restore --no-build
66+ dotnet test tests/NHapi.NUnit.SourceGeneration/NHapi.NUnit.SourceGeneration.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f netcoreapp3.1 --no-restore --no-build
67+ dotnet test tests/NHapi.NUnit/NHapi.NUnit.csproj -r TestResults -c Release -f net461 --no-restore --no-build
68+ dotnet test tests/NHapi.NUnit/NHapi.NUnit.csproj --collect:"XPlat Code Coverage" -r TestResults -c Release -f netcoreapp3.1 --no-restore --no-build
69+
3570 - name : Merge Coverage Reports
71+ if : ${{ success() || failure() }}
3672 run : |
3773 dotnet tool install -g dotnet-reportgenerator-globaltool
3874 reportgenerator "-reports:TestResults/**/coverage.cobertura.xml" "-targetdir:coverage" "-reporttypes:Cobertura"
3975
40- - name : Publish Code Coverage Results
41- uses : codecov/codecov-action@v1
76+ - name : Upload Code Coverage Report
77+ if : always()
78+ uses : actions/upload-artifact@v2
4279 with :
43- files : coverage/Cobertura.xml
80+ name : coverage-reports
81+ path : |
82+ coverage/Cobertura.xml
4483
45- - name : Test bash Coverage Uploader
46- run : |
47- Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh
48- bash codecov.sh -f '"coverage/Cobertura.xml"'
84+ publish-coverage-results :
85+ needs : build-and-test-linux
86+ name : Publish Code Coverage Results
87+ runs-on : ubuntu-latest
88+ # the build-and-test job might be skipped, we don't need to run this job then
89+ if : always()
90+ steps :
91+ - uses : actions/checkout@v2
92+
93+ - name : ' Download artifact'
94+ uses : actions/download-artifact@v2
95+ with :
96+ name : coverage-reports
97+
98+ - name : Publish Code Coverage Results
99+ uses : paambaati/codeclimate-action@v2.7.5
100+ env :
101+ CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
102+ with :
103+ coverageLocations : Cobertura.xml:cobertura
0 commit comments