-
-
Notifications
You must be signed in to change notification settings - Fork 1
127 lines (102 loc) · 3.62 KB
/
dotnetcore.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: .NET Core
on: [push, pull_request]
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
framework: ['netcoreapp3.1', 'net50', 'net60', 'net80']
steps:
- name: Check out code onto host
uses: actions/checkout@v4
- name: Setup .Net 3.1
uses: actions/setup-dotnet@v3
with:
dotnet-version: '3.1.x' # SDK Version to use.
- name: Setup .Net 5.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x' # SDK Version to use.
- name: Setup .Net 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x' # SDK Version to use.
- name: Setup .Net 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x' # SDK Version to use.
- name: Dotnet info
run: |
dotnet --version
dotnet --info
- name: Clear nuget cache
run: |
dotnet clean
dotnet nuget locals all --clear
- name: Dotnet restore
run: |
dotnet restore
- name: Build and Run unit tests
continue-on-error: true
run: |
dotnet test --no-restore --configuration Release --verbosity normal --framework=${{ matrix.framework }} --logger trx --results-directory "TestResults-${{ matrix.os }}-${{ matrix.framework }}"
#Benchmarks:
- name: Run Benchmarks
run: |
dotnet run --no-restore --configuration Release --verbosity normal --framework=${{ matrix.framework }} --project ./tests/CSRakowski.Parallel.Benchmarks/
if: matrix.framework == 'net80'
- name: Upload dotnet test results
uses: actions/upload-artifact@v3
with:
name: dotnet-results-${{ matrix.os }}-${{ matrix.framework }}
path: TestResults-${{ matrix.os }}-${{ matrix.framework }}
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: Upload BenchmarkDotNet results
uses: actions/upload-artifact@v3
with:
name: BenchmarkDotNet-${{ matrix.os }}-${{ matrix.framework }}
path: BenchmarkDotNet.Artifacts
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
build-netfx:
name: Build and test .NET Framework
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
framework: ['net45', 'net472', 'net48']
steps:
- name: Check out code onto host
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Setup .Net 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x' # SDK Version to use.
- name: Dotnet info
run: |
dotnet --version
dotnet --info
- name: Clear nuget cache
run: |
dotnet clean
dotnet nuget locals all --clear
- name: Dotnet restore
run: |
dotnet restore
- name: Build and Run unit tests
continue-on-error: true
run: |
dotnet test --no-restore --configuration Release --verbosity normal --framework=${{ matrix.framework }} --logger trx --results-directory "TestResults-${{ matrix.os }}-${{ matrix.framework }}"
- name: Upload dotnet test results
uses: actions/upload-artifact@v3
with:
name: dotnet-results-windows-latest-${{ matrix.framework }}
path: TestResults-windows-latest-${{ matrix.framework }}
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}