-
-
Notifications
You must be signed in to change notification settings - Fork 119
159 lines (137 loc) · 4.97 KB
/
dotnet.yml
File metadata and controls
159 lines (137 loc) · 4.97 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: .NET
on:
pull_request:
branches: ["main"]
workflow_dispatch:
inputs:
categories:
description: Categories to run
type: string
required: false
publish-packages:
description: Publish packages?
type: boolean
required: true
jobs:
modularpipeline:
environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Pull Requests' }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Free Disk Space (Ubuntu)
if: matrix.os == 'ubuntu-latest'
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: false
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check for .received.txt files
shell: bash
run: |
if find . -name "*.received.txt" -not -path "./node_modules/*" | grep -q .; then
echo "ERROR: .received.txt files found. These should not be committed."
echo "Please replace them with .verified.txt files or remove them."
find . -name "*.received.txt" -not -path "./node_modules/*"
exit 1
fi
- name: Setup .NET Framework
if: matrix.os == 'windows-latest'
uses: microsoft/setup-msbuild@v2
- name: Setup .NET 6
uses: actions/setup-dotnet@v5
with:
dotnet-version: 6.0.x
- name: Setup .NET 8
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
- name: Setup .NET 9
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Cache NuGet packages
uses: actions/cache@v5
continue-on-error: true
with:
path: |
~/.nuget/packages
~/.local/share/NuGet
%LocalAppData%\NuGet\v3-cache
key: nuget-${{ runner.os }}-${{ hashFiles('**/Directory.Packages.props', '**/*.csproj') }}
restore-keys: |
nuget-${{ runner.os }}-
- name: Docker Setup Docker
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-docker-action@v5.0.0
- name: Cache Playwright Browsers
uses: actions/cache@v5
continue-on-error: true
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
~/Library/Caches/ms-playwright
~/AppData/Local/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('**/package-lock.json', '**/package.json', '**/Directory.Packages.props') }}
restore-keys: |
playwright-${{ runner.os }}-
- name: Install Playwright
run: npx playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- name: Install Playwright (browsers only)
run: npx playwright install
if: steps.playwright-cache.outputs.cache-hit == 'true'
- name: Enable Long Paths on Windows
if: matrix.os == 'windows-latest'
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
shell: pwsh
- name: Build
run: dotnet build -c Release
- name: Publish AOT
run: dotnet publish TUnit.TestProject/TUnit.TestProject.csproj -c Release --use-current-runtime -p:Aot=true -o TESTPROJECT_AOT --framework net10.0
- name: Expose GitHub Actions Runtime
uses: actions/github-script@v8
with:
script: |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env['ACTIONS_RUNTIME_TOKEN']);
core.exportVariable('ACTIONS_RESULTS_URL', process.env['ACTIONS_RESULTS_URL']);
- name: Run Pipeline
uses: ./.github/actions/execute-pipeline
with:
admin-token: ${{ secrets.ADMIN_TOKEN }}
environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Development' }}
nuget-apikey: ${{ secrets.NUGET__APIKEY }}
publish-packages: ${{ (github.event.inputs.publish-packages || false) && matrix.os == 'ubuntu-latest' }}
- name: Upload Diagnostic Logs
uses: actions/upload-artifact@v7.0.0
if: always()
with:
name: TestingPlatformDiagnosticLogs${{matrix.os}}
path: '**/log_*.diag'
- name: Upload Hang Dumps
uses: actions/upload-artifact@v7.0.0
if: always()
with:
name: HangDump${{matrix.os}}
path: '**/hangdump*'
- name: NuGet Packages Artifacts
uses: actions/upload-artifact@v7.0.0
if: always()
with:
name: 'NuGetPackages-${{matrix.os}}'
path: '**/*.*nupkg'