-
Notifications
You must be signed in to change notification settings - Fork 233
47 lines (38 loc) · 1.16 KB
/
dotnet-tests.yml
File metadata and controls
47 lines (38 loc) · 1.16 KB
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
name: .NET Tests
on:
workflow_call:
inputs:
runs-on:
required: true
type: string
vs-version:
required: true
type: string
dotnet-version:
required: true
type: string
jobs:
test:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ inputs.dotnet-version }}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: ${{ inputs.vs-version }}
- name: Build
run: dotnet build DotNetBuildable.slnf /p:Configuration=Release
- name: Create global.json to enforce .NET 8 for MSBuild and update Tests/TestData projects
if: inputs.dotnet-version == '8.0.x'
shell: pwsh
run: ./.github/scripts/update-testdata-targetframework.ps1
- name: Log MSBuild version
run: msbuild -version
- name: Log .NET version
run: dotnet --info
- name: Execute unit tests
run: dotnet test Tests/Tests.csproj -c Release --framework net${{ inputs.dotnet-version == '8.0.x' && '8.0' || '10.0' }} --no-build