-
-
Notifications
You must be signed in to change notification settings - Fork 506
106 lines (97 loc) · 3.57 KB
/
test-unix-dotnet.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
name: Template Testing Unix .NET
on:
workflow_call:
inputs:
os:
required: true
type: string
description: 'The operating system to use'
image:
required: true
type: string
description: 'The image to use'
architecture:
required: true
type: string
description: 'The architecture to use'
target_framework:
required: true
type: string
description: 'The target framework to use'
target_framework_array:
required: true
type: string
description: 'The target frameworks to use'
build_configuration:
required: true
type: string
description: 'The build configuration to use'
manual_build:
required: false
type: boolean
default: true
description: 'Whether to build manually before running the tests'
upload_tests:
required: false
type: boolean
default: true
description: 'Whether to upload the test results'
experimental:
required: false
type: boolean
default: false
description: 'Whether the tests are mandatory for the build to pass'
env:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
unix-net:
name: .NET ${{inputs.os}}-${{inputs.architecture}} ${{ inputs.target_framework }} ${{inputs.build_configuration}}
runs-on: ${{inputs.image}}
continue-on-error: ${{inputs.experimental}}
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install Rosetta 2 on macOS
if: ${{inputs.image == 'macos-14' && inputs.architecture == 'x64'}}
run: /usr/sbin/softwareupdate --install-rosetta --agree-to-license
shell: pwsh
- name: Setup .NET MacOS Rosetta
uses: ./.github/actions/test-setup-dotnet-macos-rosetta
if: ${{inputs.os == 'macos-arm64' && inputs.architecture == 'x64'}}
with:
architecture: ${{inputs.architecture}}
target_framework: ${{inputs.target_framework}}
target_framework_array: ${{inputs.target_framework_array}}
- name: Setup .NET ${{inputs.architecture}}
uses: ./.github/actions/test-setup-dotnet
if: ${{!(inputs.os == 'macos-arm64' && inputs.architecture == 'x64')}}
with:
architecture: ${{inputs.architecture}}
target_framework: ${{inputs.target_framework}}
target_framework_array: ${{inputs.target_framework_array}}
- name: Get Installed .NET Sdk Information
run: dotnet --info
shell: pwsh
- name: Download Build Cache
uses: ./.github/actions/test-build-cache
if: ${{!inputs.manual_build}}
with:
os: ${{inputs.os}}
build_configuration: ${{inputs.build_configuration}}
- name: Test .NET ${{inputs.architecture}}
uses: ./.github/actions/test-execute-test
with:
os: ${{inputs.os}}
architecture: ${{inputs.architecture}}
runtime-type: dotnet
target_framework: ${{inputs.target_framework}}
target_framework_array: ${{inputs.target_framework_array}}
build_configuration: ${{inputs.build_configuration}}
manual_build: ${{inputs.manual_build}}
upload_tests: ${{inputs.upload_tests}}
experimental: ${{inputs.experimental}}