From 8870497c3473ebc75324c5356b36b4361f2a9065 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 24 Dec 2024 09:12:10 -0700 Subject: [PATCH] Move scripts that apply to github workflows from azp to tools --- .github/workflows/build.yml | 4 ++-- .github/workflows/libtemplate-update.yml | 2 +- azure-pipelines/artifacts/_stage_all.ps1 | 2 +- azure-pipelines/artifacts/build_logs.ps1 | 2 +- azure-pipelines/dotnet.yml | 6 +++--- azure-pipelines/libtemplate-update.yml | 2 +- init.ps1 | 2 +- .../Get-ArtifactsStagingDirectory.ps1 | 0 {azure-pipelines => tools}/Get-CodeCovTool.ps1 | 0 {azure-pipelines => tools}/Get-LibTemplateBasis.ps1 | 0 {azure-pipelines => tools}/Get-NuGetTool.ps1 | 0 {azure-pipelines => tools}/Get-ProcDump.ps1 | 0 {azure-pipelines => tools}/Get-TempToolsPath.ps1 | 0 tools/Install-NuGetCredProvider.ps1 | 2 +- tools/MergeFrom-Template.ps1 | 2 +- {azure-pipelines => tools}/dotnet-test-cloud.ps1 | 0 {azure-pipelines => tools}/publish-CodeCov.ps1 | 0 {azure-pipelines => tools}/test.runsettings | 0 18 files changed, 12 insertions(+), 12 deletions(-) rename {azure-pipelines => tools}/Get-ArtifactsStagingDirectory.ps1 (100%) rename {azure-pipelines => tools}/Get-CodeCovTool.ps1 (100%) rename {azure-pipelines => tools}/Get-LibTemplateBasis.ps1 (100%) rename {azure-pipelines => tools}/Get-NuGetTool.ps1 (100%) rename {azure-pipelines => tools}/Get-ProcDump.ps1 (100%) rename {azure-pipelines => tools}/Get-TempToolsPath.ps1 (100%) rename {azure-pipelines => tools}/dotnet-test-cloud.ps1 (100%) mode change 100755 => 100644 rename {azure-pipelines => tools}/publish-CodeCov.ps1 (100%) rename {azure-pipelines => tools}/test.runsettings (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58e56ccc0..5e338ffa1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: - name: ๐Ÿ›  build run: dotnet build -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904 /bl:"${{ runner.temp }}/_artifacts/build_logs/build.binlog" - name: ๐Ÿงช test - run: azure-pipelines/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }} + run: tools/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }} shell: pwsh - name: ๐Ÿ’…๐Ÿป Verify formatted code run: dotnet format --verify-no-changes --no-restore @@ -64,7 +64,7 @@ jobs: uses: ./.github/actions/publish-artifacts if: cancelled() == false - name: ๐Ÿ“ข Publish code coverage results to codecov.io - run: ./azure-pipelines/publish-CodeCov.ps1 -CodeCovToken "${{ env.codecov_token }}" -PathToCodeCoverage "${{ runner.temp }}/_artifacts/coverageResults" -Name "${{ runner.os }} Coverage Results" -Flags "${{ runner.os }}" + run: ./tools/publish-CodeCov.ps1 -CodeCovToken "${{ env.codecov_token }}" -PathToCodeCoverage "${{ runner.temp }}/_artifacts/coverageResults" -Name "${{ runner.os }} Coverage Results" -Flags "${{ runner.os }}" shell: pwsh timeout-minutes: 3 continue-on-error: true diff --git a/.github/workflows/libtemplate-update.yml b/.github/workflows/libtemplate-update.yml index f78c7e08c..c6b8fb4ab 100644 --- a/.github/workflows/libtemplate-update.yml +++ b/.github/workflows/libtemplate-update.yml @@ -25,7 +25,7 @@ jobs: id: merge shell: pwsh run: | - $LibTemplateBranch = & ./azure-pipelines/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated + $LibTemplateBranch = & ./tools/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } diff --git a/azure-pipelines/artifacts/_stage_all.ps1 b/azure-pipelines/artifacts/_stage_all.ps1 index bf961ce57..08e9844c3 100644 --- a/azure-pipelines/artifacts/_stage_all.ps1 +++ b/azure-pipelines/artifacts/_stage_all.ps1 @@ -11,7 +11,7 @@ param ( [switch]$AvoidSymbolicLinks ) -$ArtifactStagingFolder = & "$PSScriptRoot/../Get-ArtifactsStagingDirectory.ps1" -CleanIfLocal +$ArtifactStagingFolder = & "$PSScriptRoot/../../tools/Get-ArtifactsStagingDirectory.ps1" -CleanIfLocal function Create-SymbolicLink { param ( diff --git a/azure-pipelines/artifacts/build_logs.ps1 b/azure-pipelines/artifacts/build_logs.ps1 index f05358e03..10c5478b3 100644 --- a/azure-pipelines/artifacts/build_logs.ps1 +++ b/azure-pipelines/artifacts/build_logs.ps1 @@ -1,4 +1,4 @@ -$ArtifactStagingFolder = & "$PSScriptRoot/../Get-ArtifactsStagingDirectory.ps1" +$ArtifactStagingFolder = & "$PSScriptRoot/../../tools/Get-ArtifactsStagingDirectory.ps1" if (!(Test-Path $ArtifactStagingFolder/build_logs)) { return } diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml index 2444928fb..2ce80af35 100644 --- a/azure-pipelines/dotnet.yml +++ b/azure-pipelines/dotnet.yml @@ -6,7 +6,7 @@ steps: - script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904 /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog" displayName: ๐Ÿ›  dotnet build -- powershell: azure-pipelines/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults +- powershell: tools/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults displayName: ๐Ÿงช dotnet test condition: and(succeeded(), ${{ parameters.RunTests }}) @@ -22,9 +22,9 @@ steps: - ${{ if and(ne(variables['codecov_token'], ''), parameters.RunTests) }}: - powershell: | - $ArtifactStagingFolder = & "azure-pipelines/Get-ArtifactsStagingDirectory.ps1" + $ArtifactStagingFolder = & "tools/Get-ArtifactsStagingDirectory.ps1" $CoverageResultsFolder = Join-Path $ArtifactStagingFolder "coverageResults-$(Agent.JobName)" - azure-pipelines/publish-CodeCov.ps1 -CodeCovToken "$(codecov_token)" -PathToCodeCoverage "$CoverageResultsFolder" -Name "$(Agent.JobName) Coverage Results" -Flags "$(Agent.JobName)" + tools/publish-CodeCov.ps1 -CodeCovToken "$(codecov_token)" -PathToCodeCoverage "$CoverageResultsFolder" -Name "$(Agent.JobName) Coverage Results" -Flags "$(Agent.JobName)" displayName: ๐Ÿ“ข Publish code coverage results to codecov.io timeoutInMinutes: 3 continueOnError: true diff --git a/azure-pipelines/libtemplate-update.yml b/azure-pipelines/libtemplate-update.yml index 87302b067..fdfa1df54 100644 --- a/azure-pipelines/libtemplate-update.yml +++ b/azure-pipelines/libtemplate-update.yml @@ -28,7 +28,7 @@ stages: fetchDepth: 0 clean: true - pwsh: | - $LibTemplateBranch = & ./azure-pipelines/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated + $LibTemplateBranch = & ./tools/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } diff --git a/init.ps1 b/init.ps1 index e28498553..b4004e792 100755 --- a/init.ps1 +++ b/init.ps1 @@ -71,7 +71,7 @@ if (!$NoPrerequisites) { # The procdump tool and env var is required for dotnet test to collect hang/crash dumps of tests. # But it only works on Windows. if ($env:OS -eq 'Windows_NT') { - $EnvVars['PROCDUMP_PATH'] = & "$PSScriptRoot\azure-pipelines\Get-ProcDump.ps1" + $EnvVars['PROCDUMP_PATH'] = & "$PSScriptRoot\tools\Get-ProcDump.ps1" } } diff --git a/azure-pipelines/Get-ArtifactsStagingDirectory.ps1 b/tools/Get-ArtifactsStagingDirectory.ps1 similarity index 100% rename from azure-pipelines/Get-ArtifactsStagingDirectory.ps1 rename to tools/Get-ArtifactsStagingDirectory.ps1 diff --git a/azure-pipelines/Get-CodeCovTool.ps1 b/tools/Get-CodeCovTool.ps1 similarity index 100% rename from azure-pipelines/Get-CodeCovTool.ps1 rename to tools/Get-CodeCovTool.ps1 diff --git a/azure-pipelines/Get-LibTemplateBasis.ps1 b/tools/Get-LibTemplateBasis.ps1 similarity index 100% rename from azure-pipelines/Get-LibTemplateBasis.ps1 rename to tools/Get-LibTemplateBasis.ps1 diff --git a/azure-pipelines/Get-NuGetTool.ps1 b/tools/Get-NuGetTool.ps1 similarity index 100% rename from azure-pipelines/Get-NuGetTool.ps1 rename to tools/Get-NuGetTool.ps1 diff --git a/azure-pipelines/Get-ProcDump.ps1 b/tools/Get-ProcDump.ps1 similarity index 100% rename from azure-pipelines/Get-ProcDump.ps1 rename to tools/Get-ProcDump.ps1 diff --git a/azure-pipelines/Get-TempToolsPath.ps1 b/tools/Get-TempToolsPath.ps1 similarity index 100% rename from azure-pipelines/Get-TempToolsPath.ps1 rename to tools/Get-TempToolsPath.ps1 diff --git a/tools/Install-NuGetCredProvider.ps1 b/tools/Install-NuGetCredProvider.ps1 index 2b904e33e..b776f56d9 100755 --- a/tools/Install-NuGetCredProvider.ps1 +++ b/tools/Install-NuGetCredProvider.ps1 @@ -21,7 +21,7 @@ Param ( $envVars = @{} -$toolsPath = & "$PSScriptRoot\..\azure-pipelines\Get-TempToolsPath.ps1" +$toolsPath = & "$PSScriptRoot\Get-TempToolsPath.ps1" if ($IsMacOS -or $IsLinux) { $installerScript = "installcredprovider.sh" diff --git a/tools/MergeFrom-Template.ps1 b/tools/MergeFrom-Template.ps1 index 3f721c6ac..240a57097 100644 --- a/tools/MergeFrom-Template.ps1 +++ b/tools/MergeFrom-Template.ps1 @@ -36,7 +36,7 @@ Function Spawn-Tool($command, $commandArgs, $workingDirectory, $allowFailures) { } } -$remoteBranch = & $PSScriptRoot\..\azure-pipelines\Get-LibTemplateBasis.ps1 -ErrorIfNotRelated +$remoteBranch = & $PSScriptRoot\Get-LibTemplateBasis.ps1 -ErrorIfNotRelated if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } diff --git a/azure-pipelines/dotnet-test-cloud.ps1 b/tools/dotnet-test-cloud.ps1 old mode 100755 new mode 100644 similarity index 100% rename from azure-pipelines/dotnet-test-cloud.ps1 rename to tools/dotnet-test-cloud.ps1 diff --git a/azure-pipelines/publish-CodeCov.ps1 b/tools/publish-CodeCov.ps1 similarity index 100% rename from azure-pipelines/publish-CodeCov.ps1 rename to tools/publish-CodeCov.ps1 diff --git a/azure-pipelines/test.runsettings b/tools/test.runsettings similarity index 100% rename from azure-pipelines/test.runsettings rename to tools/test.runsettings