-
Notifications
You must be signed in to change notification settings - Fork 159
74 lines (62 loc) · 3.37 KB
/
receive-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Receive Pull Request
on: [pull_request]
jobs:
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@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- 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 (Windows)
if: matrix.os == 'windows-latest'
run: |
dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj --logger "trx;LogFilePrefix=TestResults" --results-directory TestResults -c Release -f net462 --no-restore --no-build
dotnet test tests\NHapi.Base.NUnit\NHapi.Base.NUnit.csproj --logger "trx;LogFilePrefix=TestResults" --results-directory TestResults -c Release -f net8.0 --no-restore --no-build
dotnet test tests\NHapi.NUnit.SourceGeneration\NHapi.NUnit.SourceGeneration.csproj --logger "trx;LogFilePrefix=TestResults" --results-directory TestResults -c Release -f net8.0 --no-restore --no-build
dotnet test tests\NHapi.NUnit\NHapi.NUnit.csproj --logger "trx;LogFilePrefix=TestResults" --results-directory TestResults -c Release -f net462 --no-restore --no-build
dotnet test tests\NHapi.NUnit\NHapi.NUnit.csproj --logger "trx;LogFilePrefix=TestResults" --results-directory TestResults -c Release -f net8.0 --no-restore --no-build
- name: Run Benchmatks (Windows)
if: matrix.os == 'windows-latest'
run: |
dotnet run -c Release --project tests\NHapi.Benchmarks\NHapi.Benchmarks.csproj -f net8.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 --collect:"XPlat Code Coverage" --results-directory TestResults -c Release -f net8.0 --no-restore --no-build
dotnet test tests/NHapi.NUnit.SourceGeneration/NHapi.NUnit.SourceGeneration.csproj --collect:"XPlat Code Coverage" --results-directory TestResults -c Release -f net8.0 --no-restore --no-build
dotnet test tests/NHapi.NUnit/NHapi.NUnit.csproj --collect:"XPlat Code Coverage" --results-directory TestResults -c Release -f net8.0 --no-restore --no-build
- name: Upload Unit Test Results
if: always() && matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: unit-test-results
path: TestResults\*.trx
- name: Upload Benchmark Results
if: always() && matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: BenchmarkDotNet.Artifacts\results
- name: Upload Code Coverage Report
if: always() && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: TestResults/