Skip to content
Merged
73 changes: 37 additions & 36 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -632,42 +632,43 @@ extends:
includeForks: true

# Local development validation
- ${{ if in(variables['Build.Reason'], 'PullRequest', 'Manual') }}:
- template: .azure/pipelines/jobs/default-build.yml@self
parameters:
jobName: Local_Windows
jobDisplayName: 'Test: Windows local development validation'
agentOs: Windows
isAzDOTestingJob: true
timeoutInMinutes: 240
steps:
- script: git submodule update --init
displayName: Update submodules
- script: ./restore.cmd
displayName: Run restore.cmd
- script: ./eng/build.cmd -all -noBuildJava -noBuildNodeJS
displayName: Build (No NodeJS)
- script: npm run build
displayName: Build JS
- script: ./eng/build.cmd -all -noBuildJava -pack -c Debug
displayName: Build (Debug)
- script: ./eng/build.cmd -all -noBuildJava -pack -c Release
displayName: Build (Release)
- script: ./src/ProjectTemplates/build.cmd
-test
-NoRestore
-NoBuild
-NoBuildDeps
-configuration Release
displayName: Run project template tests
- powershell: . ./activate.ps1; ./src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 -Verbose
displayName: Run Blazor web app test script

artifacts:
- name: Local_Windows_x64_Logs_Attempt_$(System.JobAttempt)
path: artifacts/log/
publishOnError: true
includeForks: true
- template: .azure/pipelines/jobs/default-build.yml@self
parameters:
jobName: Local_Windows
jobDisplayName: 'Test: Windows local development validation'
agentOs: Windows
isAzDOTestingJob: true
timeoutInMinutes: 240
steps:
- script: git submodule update --init
displayName: Update submodules
- script: ./restore.cmd
displayName: Run restore.cmd
- powershell: ./eng/build.ps1 -all -noBuildJava -noBuildNodeJS "-WarnAsError:false"
displayName: Build (No NodeJS)
- script: npm run build
displayName: Build JS
- script: ./eng/build.cmd -all -noBuildJava -pack -c Debug
displayName: Build (Debug)
- script: ./eng/build.cmd -all -noBuildJava -pack -c Release
displayName: Build (Release)
- script: ./src/ProjectTemplates/build.cmd
-test
-NoRestore
-NoBuild
-NoBuildDeps
-configuration Release
-bl
/p:ContinuousIntegrationBuild=true
displayName: Run project template tests
- powershell: . ./activate.ps1; ./src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 -Verbose
displayName: Run Blazor web app test script

artifacts:
- name: Local_Windows_x64_Logs_Attempt_$(System.JobAttempt)
path: artifacts/log/
publishOnError: true
includeForks: true

# Source build
- template: /eng/common/templates-official/job/source-build.yml@self
Expand Down
8 changes: 7 additions & 1 deletion src/ProjectTemplates/Shared/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,13 @@ internal async Task RunDotNetNewRawAsync(string arguments)

public void Dispose()
{
DeleteOutputDirectory();
var continuousIntegrationBuild = typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
.Single(attribute => attribute.Key == "ContinuousIntegrationBuild")
.Value;
if (string.Equals(continuousIntegrationBuild, "true", StringComparison.OrdinalIgnoreCase))
{
DeleteOutputDirectory();
}
}

public void DeleteOutputDirectory()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<_Parameter1>ContinuousIntegrationBuild</_Parameter1>
<_Parameter2>true</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(ContinuousIntegrationBuild)' != 'true'">
<_Parameter1>ContinuousIntegrationBuild</_Parameter1>
<_Parameter2>false</_Parameter2>
</AssemblyAttribute>
</ItemGroup>

<Target Name="GenerateTesDevCert" BeforeTargets="AssignTargetPaths">
Expand Down
Loading