Skip to content

Commit e2181e7

Browse files
committed
Yet another attempt to handle the unknown cause of build failures.
1 parent 89073cf commit e2181e7

File tree

5 files changed

+10
-23
lines changed

5 files changed

+10
-23
lines changed

.github/workflows/pr-build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ jobs:
2626
uses: actions/checkout@v4
2727
with:
2828
persist-credentials: false
29-
fetch-depth: 0
3029

3130
- name: Build Source
3231
run: .\Build-All.ps1 -ForceClean -BuildMode Source
@@ -61,7 +60,6 @@ jobs:
6160
uses: actions/checkout@v4
6261
with:
6362
persist-credentials: false
64-
fetch-depth: 0
6563

6664
- name: Build Docs
6765
run: .\Build-Docs.ps1 -FullInit -Configuration Release

.github/workflows/release-build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ jobs:
1212
uses: actions/checkout@v2
1313
with:
1414
persist-credentials: false
15-
fetch-depth: 0
1615

1716
- name: Build Source
18-
run: .\Build-All.ps1
17+
run: .\Build-All.ps1 -FullInit
1918

2019
- name: Publish Artifacts
2120
uses: actions/upload-artifact@v4

Build-Docs.ps1

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,9 @@ try
7373
$buildInfo = Initialize-BuildEnvironment -FullInit:$FullInit
7474
$msBuildPropertyList = ConvertTo-PropertyList @{
7575
Configuration = $Configuration
76+
RunAnalyzers = 'false'
7677
}
7778

78-
Write-Information "Current Build information"
79-
Show-FullBuildInfo $buildInfo
80-
8179
# make sure the supported tool is installed.
8280
Invoke-External dotnet tool install --global docfx --version $docFXToolVersion | Out-Null
8381

@@ -112,26 +110,12 @@ try
112110
# Thus, for now, this uses the docfx build phase.]
113111
"$([DateTime]::UtcNow.ToString('o'))" | Out-File -Path (Join-Path $docsOutputPath '.nojekyll')
114112

115-
if($buildInfo["IsAutomatedBuild"])
116-
{
117-
Write-Information "Building analyzer so it is available when building docs."
118-
# In automated builds the analyzer doesn't exist yet and it isn't listed in the docfx.json so that won't
119-
# build it either. There's nothing to document (at this point it is entirely internal). So it MUST be built
120-
# directly to support automated builds.
121-
$analyzerProjPath = Join-Path 'src' 'ReferenceEqualityVerifier' 'ReferenceEqualityVerifier' 'ReferenceEqualityVerifier.csproj'
122-
Invoke-External dotnet build '--tl:off' $analyzerProjPath '-c' $Configuration
123-
}
124-
else
125-
{
126-
Write-Information "Not an automated build; assuming analyzer already built"
127-
}
128-
129113
$fullBuildNumber = Get-FullBuildNumber
130114
push-location './docfx'
131115
try
132116
{
133117
Write-Information "Building docs [FullBuildNumber=$fullBuildNumber]"
134-
Invoke-External docfx '-m' _buildVersion=$fullBuildNumber '-o' $docsOutputPath '--warningsAsErrors'
118+
Invoke-External docfx '-m' _buildVersion=$fullBuildNumber '-o' $docsOutputPath '--warningsAsErrors' '--property' $msBuildPropertyList
135119
}
136120
finally
137121
{

PsModules/CommonBuild/CommonBuild.psm1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ function Get-FunctionsToExport
7676
return $bldr.ToString()
7777
}
7878

79+
# force preferences to what is expected
80+
# see: https://github.com/PowerShell/PowerShell/issues/4568
81+
# there is NO good solution to this beyond setting a global preference OR specifying the preference on EVERY CALL
82+
# '`tis a silly thing' - The whole PS preferences settings is a nightmarish mess.
83+
$InformationPreference = 'Continue'
84+
$ErrorInformationPreference = 'Stop'
85+
7986
# get public/Private function definition files
8087
$Public = @( Get-ChildItem -Path (Join-path $PSScriptroot 'Public' '*.ps1') -ErrorAction SilentlyContinue )
8188
$Private = @( Get-ChildItem -Path (Join-path $PSScriptroot 'Private' '*.ps1') -ErrorAction SilentlyContinue )

repo-buildutils.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Set-StrictMode -version 3.0
2121
$ErrorActionPreference = "Stop"
2222
$InformationPreference = "Continue"
2323

24-
2524
function Initialize-BuildEnvironment
2625
{
2726
<#

0 commit comments

Comments
 (0)