Skip to content

Commit 1d98c39

Browse files
committed
(build) enable diagnostics at runtime
1 parent 350309a commit 1d98c39

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

.azurepipelines/common-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ parameters:
66
steps:
77
- task: Cache@2
88
inputs:
9-
key: 'tools | "$(Agent.OS)" | build.cake'
9+
key: 'v1-tools | "$(Agent.OS)" | build.cake'
1010
path: tools
1111
displayName: Cache Cake tools
1212
- task: Cache@2
1313
inputs:
14-
key: 'dotnet | "$(Agent.OS)" | build.config'
14+
key: 'v1-dotnet | "$(Agent.OS)" | build.config'
1515
path: .dotnet
1616
displayName: Cache dotnet locally
1717
- ${{ if eq(parameters.includeArtifacts, true) }}:

.github/workflows/build.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ env:
1818
ENABLED_PUBLISH_DOCKER: true
1919
ENABLED_PUBLISH_NUGET: true
2020
ENABLED_PUBLISH_CHOCOLATEY: true
21+
ENABLED_DIAGNOSTICS: ${{ secrets.ENABLED_DIAGNOSTICS }}
2122

2223
jobs:
2324
build:
@@ -38,13 +39,13 @@ jobs:
3839
uses: actions/cache@v1
3940
with:
4041
path: tools
41-
key: ${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
42+
key: v1-${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
4243
- name: Cache dotnet
4344
id: cache-dotnet
4445
uses: actions/cache@v1
4546
with:
4647
path: .dotnet
47-
key: ${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
48+
key: v1-${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
4849
- name: '[Cake build & pack]'
4950
shell: pwsh
5051
run: ./build.ps1 -target Pack
@@ -80,13 +81,13 @@ jobs:
8081
uses: actions/cache@v1
8182
with:
8283
path: tools
83-
key: ${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
84+
key: v1-${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
8485
- name: Cache dotnet
8586
id: cache-dotnet
8687
uses: actions/cache@v1
8788
with:
8889
path: .dotnet
89-
key: ${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
90+
key: v1-${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
9091
- name: '[Run Test]'
9192
shell: pwsh
9293
run: ./build.ps1 -target Test
@@ -112,13 +113,13 @@ jobs:
112113
uses: actions/cache@v1
113114
with:
114115
path: tools
115-
key: ${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
116+
key: v1-${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
116117
- name: Cache dotnet
117118
id: cache-dotnet
118119
uses: actions/cache@v1
119120
with:
120121
path: .dotnet
121-
key: ${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
122+
key: v1-${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
122123
- uses: actions/download-artifact@v1
123124
name: Download artifacts folder
124125
with:
@@ -142,13 +143,13 @@ jobs:
142143
uses: actions/cache@v1
143144
with:
144145
path: tools
145-
key: ${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
146+
key: v1-${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
146147
- name: Cache dotnet
147148
id: cache-dotnet
148149
uses: actions/cache@v1
149150
with:
150151
path: .dotnet
151-
key: ${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
152+
key: v1-${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
152153
- uses: actions/download-artifact@v1
153154
name: Download artifacts folder
154155
with:
@@ -182,13 +183,13 @@ jobs:
182183
uses: actions/cache@v1
183184
with:
184185
path: tools
185-
key: ${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
186+
key: v1-${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
186187
- name: Cache dotnet
187188
id: cache-dotnet
188189
uses: actions/cache@v1
189190
with:
190191
path: .dotnet
191-
key: ${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
192+
key: v1-${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
192193
- uses: actions/download-artifact@v1
193194
name: Download artifacts folder
194195
with:
@@ -223,13 +224,13 @@ jobs:
223224
uses: actions/cache@v1
224225
with:
225226
path: tools
226-
key: ${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
227+
key: v1-${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
227228
- name: Cache dotnet
228229
id: cache-dotnet
229230
uses: actions/cache@v1
230231
with:
231232
path: .dotnet
232-
key: ${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
233+
key: v1-${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
233234
- uses: actions/download-artifact@v1
234235
name: Download artifacts folder
235236
with:
@@ -255,13 +256,13 @@ jobs:
255256
uses: actions/cache@v1
256257
with:
257258
path: tools
258-
key: ${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
259+
key: v1-${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
259260
- name: Cache dotnet
260261
id: cache-dotnet
261262
uses: actions/cache@v1
262263
with:
263264
path: .dotnet
264-
key: ${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
265+
key: v1-${{ runner.os }}-dotnet-${{ hashFiles('build.config') }}
265266
- uses: actions/download-artifact@v1
266267
name: Download artifacts folder
267268
with:

build.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ dotnet tool restore
181181
# Build the argument list.
182182

183183
$env:ENABLED_UNIT_TESTS = !$SkipUnitTest
184+
if ($env:ENABLED_DIAGNOSTICS -and $env:ENABLED_DIAGNOSTICS -eq $true) {
185+
Write-Host "Diagnostics enabled: Yes"
186+
$Verbosity = "Diagnostic"
187+
} else {
188+
Write-Host "Diagnostics enabled: No"
189+
}
190+
184191
$Arguments = @{
185192
target=$Target;
186193
configuration=$Configuration;

0 commit comments

Comments
 (0)