Repository navigation
175 lines (149 loc) · 6.17 KB
/
Copy pathbuild.yml
File metadata and controls
175 lines (149 loc) · 6.17 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# https://docs.github.com/actions/using-workflows/about-workflows
# https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main or release branches
push:
branches: [ main, 'dev', 'feature/*' ]
pull_request:
branches: [ main, 'dev', 'feature/*' ]
# Allows you to run this workflow manually from the Actions tab (with inputs!)
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onworkflow_dispatchinputs
workflow_dispatch:
inputs:
diagnostics:
description: 'Enable diagnostics (binlogs, dumps, etc) for this run'
required: false
default: false
type: boolean
verbosity:
description: 'MSBuild verbosity (quiet, minimal, normal, detailed, diagnostic)'
required: true
default: 'normal'
type: choice
options:
- quiet
- minimal
- normal
- detailed
- diagnostic
configuration:
description: 'Build configuration to use'
required: true
default: 'Debug'
type: choice
options:
- Debug
- Release
merge_group:
env:
DOTNET_VERSION: ${{ '9.0.x' }}
CONFIGURATION: ${{ github.event.inputs.configuration || 'Debug' }}
VERBOSITY: ${{ github.event.inputs.verbosity || 'normal' }}
IS_MAIN: ${{ github.ref == 'refs/heads/main' }}
IS_PR: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
# Check XAML Styling before trying to do anything else as a gate
Xaml-Style-Check:
runs-on: windows-2022
steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v5.1.0
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v6.0.2
with:
submodules: recursive
# Restore Tools from Manifest list in the Repository
- name: Restore dotnet tools
run: dotnet tool restore
- name: Check XAML Styling
run: powershell -version 5.1 -command "./ApplyXamlStyling.ps1 -Passive" -ErrorAction Stop
build:
needs: [Xaml-Style-Check]
runs-on: windows-2022
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# give UWP more room to breathe
- name: Configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.5
with:
minimum-size: 32GB
maximum-size: 32GB
disk-root: "C:"
- name: Enable User-Mode Dumps collecting
if: (github.event.inputs.diagnostics || 'false') == 'true'
shell: powershell
run: |
New-Item '${{ github.workspace }}\CrashDumps' -Type Directory
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpFolder' -Type ExpandString -Value '${{ github.workspace }}\CrashDumps'
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpCount' -Type DWord -Value '10'
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpType' -Type DWord -Value '2'
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v5.1.0
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: .NET Info (if diagnostics)
if: (github.event.inputs.diagnostics || 'false') == 'true'
run: dotnet --info
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v6.0.2
with:
submodules: recursive
# Restore Tools from Manifest list in the Repository
- name: Restore dotnet tools
run: dotnet tool restore
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.9,)'
# Build solution
- name: MSBuild
run: >
msbuild.exe /restore
/p:Configuration=${{ env.CONFIGURATION }}
/p:Platform=x64
/m
${{ github.event.inputs.diagnostics == 'true' && '/bl' || '' }}
/v:${{ env.VERBOSITY }}
XamlStudio.slnx
# Run tests
- name: Setup VSTest Path
uses: darenm/setup-vstest@3a16d909a1f3bbc65b52f8270d475d905e7d3e44
- name: Run XAML Studio Unit Tests
id: test-platform
run: vstest.console.exe ./XamlStudio.Toolkit.UnitTests/**/XamlStudio.Toolkit.UnitTests.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=XamlStudio.trx" /Blame
- name: Artifact - Diagnostic Logs
uses: actions/upload-artifact@v6
if: ${{ (github.event.inputs.diagnostics || 'false') == 'true' && always() }}
with:
name: build-logs-xaml-studio
path: ./**/*.*log
- name: Artifact - ILC Repro
uses: actions/upload-artifact@v6
if: ${{ (github.event.inputs.diagnostics || 'false') == 'true' && always() }}
with:
name: ilc-repro
path: ./*.zip
# https://github.com/dorny/paths-filter#custom-processing-of-changed-files
- name: Detect If any Dump Files
id: detect-dump
if: always()
working-directory: ${{ github.workspace }}
run: |
echo "DUMP_FILE=$(Get-ChildItem .\CrashDumps\*.dmp -ErrorAction SilentlyContinue)" >> $env:GITHUB_OUTPUT
- name: Artifact - WER crash dumps
uses: actions/upload-artifact@v6
if: ${{ (github.event.inputs.diagnostics || 'false') == 'true' && always() }}
with:
name: CrashDumps-xaml-studio
path: '${{ github.workspace }}/CrashDumps'
- name: Analyze Dump
if: ${{ steps.detect-dump.outputs.DUMP_FILE != '' && (github.event.inputs.diagnostics || 'false') == 'true' && always() }}
run: |
dotnet tool install --global dotnet-dump
dotnet-dump analyze ${{ steps.detect-dump.outputs.DUMP_FILE }} -c "clrstack" -c "pe -lines" -c "exit"