From 7e83718409af53201d474c1bef2bc3bc397c9fd5 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 11:51:42 -0800 Subject: [PATCH 01/63] Add workflow powershell/Convert/ForConversion-Windows-CI --- .../workflows/forconversion-windows-ci.yml | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/forconversion-windows-ci.yml diff --git a/.github/workflows/forconversion-windows-ci.yml b/.github/workflows/forconversion-windows-ci.yml new file mode 100644 index 00000000000..645efc782e0 --- /dev/null +++ b/.github/workflows/forconversion-windows-ci.yml @@ -0,0 +1,76 @@ +name: powershell/Convert/ForConversion-Windows-CI +on: + push: + branches: + - master + - release* + - feature* + paths: + - "*" + - "!.vsts-ci/misc-analysis.yml" + - "!.github/ISSUE_TEMPLATE/*" + - "!.github/workflows/*" + - "!.dependabot/config.yml" + - "!test/perf/*" + - "!.pipelines/*" + pull_request: + branches: + - master + - release* + - feature* + paths: + - ".vsts-ci/templates/*" + - ".vsts-ci/windows.yml" + - "*.props" + - build.psm1 + - src/* + - test/* + - tools/buildCommon/* + - tools/ci.psm1 + - tools/WindowsCI.psm1 + - "!test/common/markdown/*" + - "!test/perf/*" +env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + GIT_CONFIG_PARAMETERS: "'core.autocrlf=false'" + NugetSecurityAnalysisWarningLevel: none + POWERSHELL_TELEMETRY_OPTOUT: 1 + __SuppressAnsiEscapeSequences: 1 + nugetMultiFeedWarnLevel: none +jobs: + vsts_ci_templates_ci_build: + name: vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_ci_build.yml" + vsts_ci_templates_windows_test: + name: vsts_ci_templates_windows_test + needs: vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_windows_test.yml" + with: + purpose: UnelevatedPesterTests + tagSet: CI + vsts_ci_templates_windows_test_2: + name: vsts_ci_templates_windows_test_2 + needs: vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_windows_test.yml" + with: + purpose: ElevatedPesterTests + tagSet: CI + vsts_ci_templates_windows_test_3: + name: vsts_ci_templates_windows_test_3 + needs: vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_windows_test.yml" + with: + purpose: UnelevatedPesterTests + tagSet: Others + vsts_ci_templates_windows_test_4: + name: vsts_ci_templates_windows_test_4 + needs: vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_windows_test.yml" + with: + purpose: ElevatedPesterTests + tagSet: Others + vsts_ci_templates_verify_xunit: + name: vsts_ci_templates_verify_xunit + needs: vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_verify_xunit.yml" From 306cfa18ef33dcb40b81f1428cbe413318dfd0d8 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 11:51:44 -0800 Subject: [PATCH 02/63] Add composite action tools_releaseBuild_azureDevOps_templates_insert_nuget_config_azfeed --- .../action.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml diff --git a/.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml b/.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml new file mode 100644 index 00000000000..b46c179745f --- /dev/null +++ b/.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml @@ -0,0 +1,11 @@ +name: tools_releaseBuild_azureDevOps_templates_insert_nuget_config_azfeed +inputs: + repoRoot: + required: false + default: "$(REPOROOT)" +runs: + using: composite + steps: + - uses: "./.github/actions/pipelines_templates_insert_nuget_config_azfeed" + with: + repoRoot: "${{ env.REPOROOT }}" \ No newline at end of file From c3991de2831673e0c64c66e5e8119040e3b8bf45 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 11:51:45 -0800 Subject: [PATCH 03/63] Add composite action pipelines_templates_insert_nuget_config_azfeed --- .../action.yml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml diff --git a/.github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml b/.github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml new file mode 100644 index 00000000000..ddac1647309 --- /dev/null +++ b/.github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml @@ -0,0 +1,59 @@ +name: pipelines_templates_insert_nuget_config_azfeed +inputs: + repoRoot: + required: false + default: "$(REPOROOT)" + ob_restore_phase: + required: false + default: true + type: boolean +runs: + using: composite + steps: + - name: Install Azure Artifacts Credential Provider + uses: actions/setup-dotnet@v4.0.0 + env: + NUGET_AUTH_TOKEN: "${{ secrets.NUGET_AUTH_TOKEN }}" + NUGET_FEED_URL: "${{ env.NUGET_FEED_URL }}" + with: + source-url: "${{ env.NUGET_FEED_URL }}" + - name: Switch to production Azure DevOps feed for all nuget.configs + if: "(success() || failure()) && env.UseAzDevOpsFeed != ''" + env: + NUGETCONFIGDIR: "${{ inputs.repoRoot }}/src/Modules" + OB_RESTORE_PHASE: "${{ inputs.ob_restore_phase }}" + run: |- + try { + $configPath = "${env:NugetConfigDir}/nuget.config" + Import-Module ${{ inputs.repoRoot }}/build.psm1 -Force + + Write-Verbose -Verbose "Running: Switch-PSNugetConfig -Source Private -UserName '${{ env.AzDevopsFeedUserNameKVPAT }}' -ClearTextPAT '${{ env.powershellPackageReadPat }}'" + Switch-PSNugetConfig -Source Private -UserName '${{ env.AzDevopsFeedUserNameKVPAT }}' -ClearTextPAT '${{ env.powershellPackageReadPat }}' + + if(-not (Test-Path $configPath)) + { + throw "nuget.config is not created" + } + } + catch { + Get-Error + throw + } + shell: pwsh + - name: Capture all nuget.config files + if: "(success() || failure()) && env.UseAzDevOpsFeed != ''" + env: + OB_RESTORE_PHASE: "${{ inputs.ob_restore_phase }}" + run: |- + Get-ChildItem ${{ inputs.repoRoot }}/nuget.config -Recurse | Foreach-Object { + Write-Verbose -Verbose "--- START $($_.fullname) ---" + get-content $_.fullname | Out-String -width 9999 -Stream | write-Verbose -Verbose + Write-Verbose -Verbose "--- END $($_.fullname) ---" + } + shell: pwsh + - name: Capture VSS* Environment + if: "(success() || failure()) && env.UseAzDevOpsFeed != ''" + env: + OB_RESTORE_PHASE: "${{ inputs.ob_restore_phase }}" + run: Get-ChildItem -Path env:VSS* | Out-String -width 9999 -Stream | write-Verbose -Verbose + shell: pwsh \ No newline at end of file From 1b1c38c0577162209281362c61985985bb6252b1 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 11:51:46 -0800 Subject: [PATCH 04/63] Add reusable workflow vsts_ci_templates_ci_build --- .../workflows/vsts_ci_templates_ci_build.yml | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/vsts_ci_templates_ci_build.yml diff --git a/.github/workflows/vsts_ci_templates_ci_build.yml b/.github/workflows/vsts_ci_templates_ci_build.yml new file mode 100644 index 00000000000..a21a3ffa569 --- /dev/null +++ b/.github/workflows/vsts_ci_templates_ci_build.yml @@ -0,0 +1,77 @@ +# Environment variables defined in a calling workflow are not accessible to this reusable workflow. Refer to the documentation for further details on this limitation. +name: vsts_ci_templates_ci_build +on: + workflow_call: + inputs: + pool: + required: false + default: windows-latest + imageName: + required: false + default: PSWindows11-ARM64 + jobName: + required: false + default: win_build + displayName: + required: false + default: Windows Build + PoolType: + required: false + default: AzDoHosted + type: string +jobs: + ${{ parameters.jobName }}: + name: ${{ parameters.displayName }} + runs-on: windows-latest + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + - name: Install PowerShell + run: |- + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 + $pwsh = Get-Command pwsh -ErrorAction SilentlyContinue -CommandType Application + if ($null -eq $pwsh) { + $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' + Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -outfile ./install-powershell.ps1 + ./install-powershell.ps1 -Destination $powerShellPath + $vstsCommandString = "vso[task.setvariable variable=PATH]$powerShellPath;$env:PATH" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + } + shell: powershell + - uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 + - name: Capture Environment + if: success() || failure() + run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' + shell: pwsh + - name: Set Build Name for Non-PR + if: github.event_name != 'PullRequest' + run: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" + shell: pwsh + - uses: "./.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed" + if: env.UseAzDevOpsFeed != '' + - name: Bootstrap + if: success() + run: |- + Import-Module .\tools\ci.psm1 + Invoke-CIInstall -SkipUser + Write-Verbose -Verbose "Start Sync-PSTags" + Sync-PSTags -AddRemoteIfMissing + Write-Verbose -Verbose "End Sync-PSTags" + shell: pwsh + - name: Build + if: success() + run: |- + Import-Module .\tools\ci.psm1 + Invoke-CIBuild + shell: pwsh + - name: xUnit Tests + if: success() + continue-on-error: true + run: |- + Import-Module .\tools\ci.psm1 + Restore-PSOptions + Invoke-CIxUnit -SkipFailing + shell: pwsh From d42ffd4d3d7ba6845024234c3e0f9c72b6867df6 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 11:51:47 -0800 Subject: [PATCH 05/63] Add reusable workflow vsts_ci_templates_windows_test --- .../vsts_ci_templates_windows_test.yml | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/vsts_ci_templates_windows_test.yml diff --git a/.github/workflows/vsts_ci_templates_windows_test.yml b/.github/workflows/vsts_ci_templates_windows_test.yml new file mode 100644 index 00000000000..605b8c7c5fe --- /dev/null +++ b/.github/workflows/vsts_ci_templates_windows_test.yml @@ -0,0 +1,85 @@ +# Environment variables defined in a calling workflow are not accessible to this reusable workflow. Refer to the documentation for further details on this limitation. +name: vsts_ci_templates_windows_test +on: + workflow_call: + inputs: + pool: + required: false + default: windows-2019 + type: string + imageName: + required: false + default: PSWindows11-ARM64 + type: string + purpose: + required: false + default: '' + type: string + tagSet: + required: false + default: CI + type: string +jobs: + win_test_${{ parameters.purpose }}_${{ parameters.tagSet }}: + name: Windows Test - ${{ parameters.purpose }} - ${{ parameters.tagSet }} + runs-on: windows-latest + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + - name: Install PowerShell if missing + if: "'inputs.pool' != 'windows-2019'" + run: |- + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 + $pwsh = Get-Command pwsh -ErrorAction SilentlyContinue -CommandType Application + if ($null -eq $pwsh) { + $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' + Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -outfile ./install-powershell.ps1 + ./install-powershell.ps1 -Destination $powerShellPath + $vstsCommandString = "vso[task.setvariable variable=PATH]$powerShellPath;$env:PATH" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + } + shell: powershell + - name: Capture Environment + if: success() || failure() + run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' + shell: pwsh +# # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). +# # Ensure the workflow exists and uploads an artifact for this to use. +# - name: Download Build Artifacts +# uses: dawidd6/action-download-artifact@v3.0.0 +# with: +# github_token: "${{ secrets.GITHUB_TOKEN }}" +# path: "${{ github.workspace }}" +# repo: "${{ github.repository }}" + - name: Capture Artifacts Directory + continue-on-error: true + run: Get-ChildItem "${{ github.workspace }}\*" -Recurse + shell: pwsh + - name: Bootstrap + run: |- + # Remove "Program Files\dotnet" from the env variable PATH, so old SDKs won't affect us. + Write-Host "Old Path:" + Write-Host $env:Path + $dotnetPath = Join-Path $env:SystemDrive 'Program Files\dotnet' + $paths = $env:Path -split ";" | Where-Object { -not $_.StartsWith($dotnetPath) } + $env:Path = $paths -join ";" + Write-Host "New Path:" + Write-Host $env:Path + # Bootstrap + Import-Module .\tools\ci.psm1 + Invoke-CIInstall + shell: powershell + - name: Test + if: success() + run: |- + Import-Module .\build.psm1 -force + Start-PSBootstrap + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '${{ github.workspace }}\build\psoptions.json' + $options = (Get-PSOptions) + $path = split-path -path $options.Output + $rootPath = split-Path -path $path + Expand-Archive -Path '${{ github.workspace }}\build\build.zip' -DestinationPath $rootPath -Force + Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' + shell: pwsh From ed2bd8b167023b7c91b819bb0dc6eefe76090502 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 11:51:48 -0800 Subject: [PATCH 06/63] Add reusable workflow vsts_ci_templates_verify_xunit --- .../vsts_ci_templates_verify_xunit.yml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/vsts_ci_templates_verify_xunit.yml diff --git a/.github/workflows/vsts_ci_templates_verify_xunit.yml b/.github/workflows/vsts_ci_templates_verify_xunit.yml new file mode 100644 index 00000000000..415d64e10af --- /dev/null +++ b/.github/workflows/vsts_ci_templates_verify_xunit.yml @@ -0,0 +1,39 @@ +# Environment variables defined in a calling workflow are not accessible to this reusable workflow. Refer to the documentation for further details on this limitation. +name: vsts_ci_templates_verify_xunit +on: + workflow_call: + inputs: + pool: + required: false + default: windows-latest + type: string + jobName: + required: false + default: xunit_verify + type: string +jobs: + verify_xunit: + name: Verify xUnit Results + runs-on: ${{ inputs.pool }} + steps: + - name: checkout + uses: actions/checkout@v4.1.0 +# # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). +# # Ensure the workflow exists and uploads an artifact for this to use. +# - name: Download build artifacts +# uses: dawidd6/action-download-artifact@v3.0.0 +# with: +# github_token: "${{ secrets.GITHUB_TOKEN }}" +# path: "${{ github.workspace }}" +# repo: "${{ github.repository }}" + - name: Capture artifacts directory + continue-on-error: true + run: dir "${{ github.workspace }}\*" -Recurse + shell: pwsh + - name: Test + if: success() + run: |- + Import-Module .\tools\ci.psm1 + $xUnitTestResultsFile = "${{ github.workspace }}\xunit\xUnitTestResults.xml" + Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile + shell: pwsh From 4fef4086cc7b75223f13a421841a9d932152e99d Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 11:55:20 -0800 Subject: [PATCH 07/63] Rename and update Windows CI workflow --- .../workflows/{forconversion-windows-ci.yml => windows-ci.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{forconversion-windows-ci.yml => windows-ci.yml} (99%) diff --git a/.github/workflows/forconversion-windows-ci.yml b/.github/workflows/windows-ci.yml similarity index 99% rename from .github/workflows/forconversion-windows-ci.yml rename to .github/workflows/windows-ci.yml index 645efc782e0..d14c6e73c95 100644 --- a/.github/workflows/forconversion-windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -73,4 +73,4 @@ jobs: vsts_ci_templates_verify_xunit: name: vsts_ci_templates_verify_xunit needs: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_verify_xunit.yml" + uses: "./.github/workflows/vsts_ci_templates_verify_xunit.yml" \ No newline at end of file From 11dae80dcaacf5c9d918576e53c3903fe2406069 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 11:58:20 -0800 Subject: [PATCH 08/63] Update .github/workflows/windows-ci.yml --- .github/workflows/windows-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index d14c6e73c95..a64a4861255 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -1,4 +1,4 @@ -name: powershell/Convert/ForConversion-Windows-CI +name: Windows-CI on: push: branches: From a0acfb89814cf5a4f475bc6932da82b395446bb9 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 11:59:02 -0800 Subject: [PATCH 09/63] Update .github/workflows/windows-ci.yml --- .github/workflows/windows-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index a64a4861255..3963452129d 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -73,4 +73,4 @@ jobs: vsts_ci_templates_verify_xunit: name: vsts_ci_templates_verify_xunit needs: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_verify_xunit.yml" \ No newline at end of file + uses: "./.github/workflows/vsts_ci_templates_verify_xunit.yml" From 05158fcfcf7bd37e69c125f8fd3b131e6010842f Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 11:59:30 -0800 Subject: [PATCH 10/63] Update .github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml --- .../action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml b/.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml index b46c179745f..0d27a741e65 100644 --- a/.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml +++ b/.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml @@ -8,4 +8,4 @@ runs: steps: - uses: "./.github/actions/pipelines_templates_insert_nuget_config_azfeed" with: - repoRoot: "${{ env.REPOROOT }}" \ No newline at end of file + repoRoot: "${{ env.REPOROOT }}" From fd3fc29fbd4a04e5a733db86c18862d44f7cd0b6 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 11:59:51 -0800 Subject: [PATCH 11/63] Update .github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml --- .../pipelines_templates_insert_nuget_config_azfeed/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml b/.github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml index ddac1647309..9b5565af000 100644 --- a/.github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml +++ b/.github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml @@ -56,4 +56,4 @@ runs: env: OB_RESTORE_PHASE: "${{ inputs.ob_restore_phase }}" run: Get-ChildItem -Path env:VSS* | Out-String -width 9999 -Stream | write-Verbose -Verbose - shell: pwsh \ No newline at end of file + shell: pwsh From e900566ece8729052b0d1e77da279a17645a9141 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 12:01:52 -0800 Subject: [PATCH 12/63] Update .github/workflows/vsts_ci_templates_verify_xunit.yml --- .../workflows/vsts_ci_templates_verify_xunit.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vsts_ci_templates_verify_xunit.yml b/.github/workflows/vsts_ci_templates_verify_xunit.yml index 415d64e10af..8841b5b0c72 100644 --- a/.github/workflows/vsts_ci_templates_verify_xunit.yml +++ b/.github/workflows/vsts_ci_templates_verify_xunit.yml @@ -18,14 +18,14 @@ jobs: steps: - name: checkout uses: actions/checkout@v4.1.0 -# # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). -# # Ensure the workflow exists and uploads an artifact for this to use. -# - name: Download build artifacts -# uses: dawidd6/action-download-artifact@v3.0.0 -# with: -# github_token: "${{ secrets.GITHUB_TOKEN }}" -# path: "${{ github.workspace }}" -# repo: "${{ github.repository }}" + # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). + # Ensure the workflow exists and uploads an artifact for this to use. + - name: Download build artifacts + uses: dawidd6/action-download-artifact@v3.0.0 + with: + github_token: "${{ secrets.GITHUB_TOKEN }}" + path: "${{ github.workspace }}" + repo: "${{ github.repository }}" - name: Capture artifacts directory continue-on-error: true run: dir "${{ github.workspace }}\*" -Recurse From 74649801f89dd91bddab372cd931f3066e67c334 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 12:03:18 -0800 Subject: [PATCH 13/63] Update .github/workflows/vsts_ci_templates_windows_test.yml --- .../workflows/vsts_ci_templates_windows_test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/vsts_ci_templates_windows_test.yml b/.github/workflows/vsts_ci_templates_windows_test.yml index 605b8c7c5fe..5667e6889f4 100644 --- a/.github/workflows/vsts_ci_templates_windows_test.yml +++ b/.github/workflows/vsts_ci_templates_windows_test.yml @@ -44,14 +44,14 @@ jobs: if: success() || failure() run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' shell: pwsh -# # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). -# # Ensure the workflow exists and uploads an artifact for this to use. -# - name: Download Build Artifacts -# uses: dawidd6/action-download-artifact@v3.0.0 -# with: -# github_token: "${{ secrets.GITHUB_TOKEN }}" -# path: "${{ github.workspace }}" -# repo: "${{ github.repository }}" + # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). + # Ensure the workflow exists and uploads an artifact for this to use. + - name: Download Build Artifacts + uses: dawidd6/action-download-artifact@v3.0.0 + with: + github_token: "${{ secrets.GITHUB_TOKEN }}" + path: "${{ github.workspace }}" + repo: "${{ github.repository }}" - name: Capture Artifacts Directory continue-on-error: true run: Get-ChildItem "${{ github.workspace }}\*" -Recurse From 912f9cd804384566ec637cac339bb840881c7965 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 12:12:57 -0800 Subject: [PATCH 14/63] update templates --- .../build/ci.yml} | 0 .../test/verify_xunit.yml} | 0 .../test/windows.yml} | 0 .github/workflows/windows-ci.yml | 46 +++++++++---------- 4 files changed, 23 insertions(+), 23 deletions(-) rename .github/workflows/{vsts_ci_templates_ci_build.yml => templates/build/ci.yml} (100%) rename .github/workflows/{vsts_ci_templates_verify_xunit.yml => templates/test/verify_xunit.yml} (100%) rename .github/workflows/{vsts_ci_templates_windows_test.yml => templates/test/windows.yml} (100%) diff --git a/.github/workflows/vsts_ci_templates_ci_build.yml b/.github/workflows/templates/build/ci.yml similarity index 100% rename from .github/workflows/vsts_ci_templates_ci_build.yml rename to .github/workflows/templates/build/ci.yml diff --git a/.github/workflows/vsts_ci_templates_verify_xunit.yml b/.github/workflows/templates/test/verify_xunit.yml similarity index 100% rename from .github/workflows/vsts_ci_templates_verify_xunit.yml rename to .github/workflows/templates/test/verify_xunit.yml diff --git a/.github/workflows/vsts_ci_templates_windows_test.yml b/.github/workflows/templates/test/windows.yml similarity index 100% rename from .github/workflows/vsts_ci_templates_windows_test.yml rename to .github/workflows/templates/test/windows.yml diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 3963452129d..6572ba043f9 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -39,38 +39,38 @@ env: __SuppressAnsiEscapeSequences: 1 nugetMultiFeedWarnLevel: none jobs: - vsts_ci_templates_ci_build: - name: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_ci_build.yml" - vsts_ci_templates_windows_test: - name: vsts_ci_templates_windows_test - needs: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_windows_test.yml" + ci_build: + name: ci_build + uses: "./.github/workflows/templates/build/ci.yml" + windows_test: + name: windows_test + needs: ci_build + uses: "./.github/workflows/templates/test/windows.yml" with: purpose: UnelevatedPesterTests tagSet: CI - vsts_ci_templates_windows_test_2: - name: vsts_ci_templates_windows_test_2 - needs: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_windows_test.yml" + windows_test_2: + name: windows_test_2 + needs: ci_build + uses: "./.github/workflows/templates/test/windows.yml" with: purpose: ElevatedPesterTests tagSet: CI - vsts_ci_templates_windows_test_3: - name: vsts_ci_templates_windows_test_3 - needs: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_windows_test.yml" + windows_test_3: + name: windows_test_3 + needs: ci_build + uses: "./.github/workflows/templates/test/windows.yml" with: purpose: UnelevatedPesterTests tagSet: Others - vsts_ci_templates_windows_test_4: - name: vsts_ci_templates_windows_test_4 - needs: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_windows_test.yml" + windows_test_4: + name: windows_test_4 + needs: ci_build + uses: "./.github/workflows/templates/test/windows.yml" with: purpose: ElevatedPesterTests tagSet: Others - vsts_ci_templates_verify_xunit: - name: vsts_ci_templates_verify_xunit - needs: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_verify_xunit.yml" + verify_xunit: + name: verify_xunit + needs: ci_build + uses: "./.github/workflows/templates/verify_xunit.yml" From b317017a46384a8bbc47e26fd7ef0b8373902956 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 12:17:47 -0800 Subject: [PATCH 15/63] Cleanup workflow --- .github/workflows/windows-ci.yml | 60 +++++++++++++++++--------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 6572ba043f9..10d40b1893e 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -1,35 +1,37 @@ name: Windows-CI on: + workflow_dispatch: push: branches: - - master - - release* - - feature* + - master + - release* + - feature* paths: - - "*" - - "!.vsts-ci/misc-analysis.yml" - - "!.github/ISSUE_TEMPLATE/*" - - "!.github/workflows/*" - - "!.dependabot/config.yml" - - "!test/perf/*" - - "!.pipelines/*" + - "*" + - "!.vsts-ci/misc-analysis.yml" + - "!.github/ISSUE_TEMPLATE/*" + - "!.github/workflows/*" + - "!.dependabot/config.yml" + - "!test/perf/*" + - "!.pipelines/*" pull_request: branches: - - master - - release* - - feature* + - master + - release* + - feature* paths: - - ".vsts-ci/templates/*" - - ".vsts-ci/windows.yml" - - "*.props" - - build.psm1 - - src/* - - test/* - - tools/buildCommon/* - - tools/ci.psm1 - - tools/WindowsCI.psm1 - - "!test/common/markdown/*" - - "!test/perf/*" + - ".vsts-ci/templates/*" + - ".vsts-ci/windows.yml" + - "*.props" + - build.psm1 + - src/* + - test/* + - tools/buildCommon/* + - tools/ci.psm1 + - tools/WindowsCI.psm1 + - "!test/common/markdown/*" + - "!test/perf/*" + env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 @@ -43,34 +45,34 @@ jobs: name: ci_build uses: "./.github/workflows/templates/build/ci.yml" windows_test: - name: windows_test + name: Windows Unelevated CI needs: ci_build uses: "./.github/workflows/templates/test/windows.yml" with: purpose: UnelevatedPesterTests tagSet: CI windows_test_2: - name: windows_test_2 + name: windows Elevated CI needs: ci_build uses: "./.github/workflows/templates/test/windows.yml" with: purpose: ElevatedPesterTests tagSet: CI windows_test_3: - name: windows_test_3 + name: Windows Unelevated Others needs: ci_build uses: "./.github/workflows/templates/test/windows.yml" with: purpose: UnelevatedPesterTests tagSet: Others windows_test_4: - name: windows_test_4 + name: Windows Elevated Others needs: ci_build uses: "./.github/workflows/templates/test/windows.yml" with: purpose: ElevatedPesterTests tagSet: Others verify_xunit: - name: verify_xunit + name: Verify xUnit test results needs: ci_build uses: "./.github/workflows/templates/verify_xunit.yml" From 84632382e76fa35184b138b337e46c5616fd3d59 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 12:40:28 -0800 Subject: [PATCH 16/63] translate workflows to composite actions --- .github/actions/build/ci/action.yml | 56 ++++++++++++ .github/actions/test/verify_xunit/action.yml | 27 ++++++ .github/actions/test/windows/action.yml | 75 ++++++++++++++++ .github/workflows/templates/build/ci.yml | 77 ----------------- .../workflows/templates/test/verify_xunit.yml | 39 --------- .github/workflows/templates/test/windows.yml | 85 ------------------- .github/workflows/windows-ci.yml | 48 +++++++---- 7 files changed, 188 insertions(+), 219 deletions(-) create mode 100644 .github/actions/build/ci/action.yml create mode 100644 .github/actions/test/verify_xunit/action.yml create mode 100644 .github/actions/test/windows/action.yml delete mode 100644 .github/workflows/templates/build/ci.yml delete mode 100644 .github/workflows/templates/test/verify_xunit.yml delete mode 100644 .github/workflows/templates/test/windows.yml diff --git a/.github/actions/build/ci/action.yml b/.github/actions/build/ci/action.yml new file mode 100644 index 00000000000..452597b9cb5 --- /dev/null +++ b/.github/actions/build/ci/action.yml @@ -0,0 +1,56 @@ +name: CI Build +description: 'Builds PowerShell' +runs: + using: composite + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + - name: Install PowerShell + run: |- + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 + $pwsh = Get-Command pwsh -ErrorAction SilentlyContinue -CommandType Application + if ($null -eq $pwsh) { + $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' + Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -outfile ./install-powershell.ps1 + ./install-powershell.ps1 -Destination $powerShellPath + $vstsCommandString = "vso[task.setvariable variable=PATH]$powerShellPath;$env:PATH" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + } + shell: powershell + - uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 + - name: Capture Environment + if: success() || failure() + run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' + shell: pwsh + - name: Set Build Name for Non-PR + if: github.event_name != 'PullRequest' + run: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" + shell: pwsh + - uses: "./.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed" + if: env.UseAzDevOpsFeed != '' + - name: Bootstrap + if: success() + run: |- + Import-Module .\tools\ci.psm1 + Invoke-CIInstall -SkipUser + Write-Verbose -Verbose "Start Sync-PSTags" + Sync-PSTags -AddRemoteIfMissing + Write-Verbose -Verbose "End Sync-PSTags" + shell: pwsh + - name: Build + if: success() + run: |- + Import-Module .\tools\ci.psm1 + Invoke-CIBuild + shell: pwsh + - name: xUnit Tests + if: success() + continue-on-error: true + run: |- + Import-Module .\tools\ci.psm1 + Restore-PSOptions + Invoke-CIxUnit -SkipFailing + shell: pwsh diff --git a/.github/actions/test/verify_xunit/action.yml b/.github/actions/test/verify_xunit/action.yml new file mode 100644 index 00000000000..d7ddf16d2ce --- /dev/null +++ b/.github/actions/test/verify_xunit/action.yml @@ -0,0 +1,27 @@ +name: verify_xunit +description: 'Verify xUnit Results' + +runs: + using: composite + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). + # Ensure the workflow exists and uploads an artifact for this to use. + - name: Download build artifacts + uses: dawidd6/action-download-artifact@v3.0.0 + with: + github_token: "${{ secrets.GITHUB_TOKEN }}" + path: "${{ github.workspace }}" + repo: "${{ github.repository }}" + - name: Capture artifacts directory + continue-on-error: true + run: dir "${{ github.workspace }}\*" -Recurse + shell: pwsh + - name: Test + if: success() + run: |- + Import-Module .\tools\ci.psm1 + $xUnitTestResultsFile = "${{ github.workspace }}\xunit\xUnitTestResults.xml" + Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile + shell: pwsh diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml new file mode 100644 index 00000000000..71bf4b8620c --- /dev/null +++ b/.github/actions/test/windows/action.yml @@ -0,0 +1,75 @@ +name: windows_test +description: 'Test PowerShell on Windows' + +inputs: + purpose: + required: false + default: '' + type: string + tagSet: + required: false + default: CI + type: string + +runs: + using: composite + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + - name: Install PowerShell if missing + if: "'inputs.pool' != 'windows-2019'" + run: |- + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 + $pwsh = Get-Command pwsh -ErrorAction SilentlyContinue -CommandType Application + if ($null -eq $pwsh) { + $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' + Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -outfile ./install-powershell.ps1 + ./install-powershell.ps1 -Destination $powerShellPath + $vstsCommandString = "vso[task.setvariable variable=PATH]$powerShellPath;$env:PATH" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + } + shell: powershell + - name: Capture Environment + if: success() || failure() + run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' + shell: pwsh + # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). + # Ensure the workflow exists and uploads an artifact for this to use. + - name: Download Build Artifacts + uses: dawidd6/action-download-artifact@v3.0.0 + with: + github_token: "${{ secrets.GITHUB_TOKEN }}" + path: "${{ github.workspace }}" + repo: "${{ github.repository }}" + - name: Capture Artifacts Directory + continue-on-error: true + run: Get-ChildItem "${{ github.workspace }}\*" -Recurse + shell: pwsh + - name: Bootstrap + run: |- + # Remove "Program Files\dotnet" from the env variable PATH, so old SDKs won't affect us. + Write-Host "Old Path:" + Write-Host $env:Path + $dotnetPath = Join-Path $env:SystemDrive 'Program Files\dotnet' + $paths = $env:Path -split ";" | Where-Object { -not $_.StartsWith($dotnetPath) } + $env:Path = $paths -join ";" + Write-Host "New Path:" + Write-Host $env:Path + # Bootstrap + Import-Module .\tools\ci.psm1 + Invoke-CIInstall + shell: powershell + - name: Test + if: success() + run: |- + Import-Module .\build.psm1 -force + Start-PSBootstrap + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '${{ github.workspace }}\build\psoptions.json' + $options = (Get-PSOptions) + $path = split-path -path $options.Output + $rootPath = split-Path -path $path + Expand-Archive -Path '${{ github.workspace }}\build\build.zip' -DestinationPath $rootPath -Force + Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' + shell: pwsh diff --git a/.github/workflows/templates/build/ci.yml b/.github/workflows/templates/build/ci.yml deleted file mode 100644 index a21a3ffa569..00000000000 --- a/.github/workflows/templates/build/ci.yml +++ /dev/null @@ -1,77 +0,0 @@ -# Environment variables defined in a calling workflow are not accessible to this reusable workflow. Refer to the documentation for further details on this limitation. -name: vsts_ci_templates_ci_build -on: - workflow_call: - inputs: - pool: - required: false - default: windows-latest - imageName: - required: false - default: PSWindows11-ARM64 - jobName: - required: false - default: win_build - displayName: - required: false - default: Windows Build - PoolType: - required: false - default: AzDoHosted - type: string -jobs: - ${{ parameters.jobName }}: - name: ${{ parameters.displayName }} - runs-on: windows-latest - steps: - - name: checkout - uses: actions/checkout@v4.1.0 - - name: Install PowerShell - run: |- - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 - $pwsh = Get-Command pwsh -ErrorAction SilentlyContinue -CommandType Application - if ($null -eq $pwsh) { - $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' - Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -outfile ./install-powershell.ps1 - ./install-powershell.ps1 -Destination $powerShellPath - $vstsCommandString = "vso[task.setvariable variable=PATH]$powerShellPath;$env:PATH" - Write-Host "sending " + $vstsCommandString - Write-Host "##$vstsCommandString" - } - shell: powershell - - uses: actions/checkout@v4.1.0 - with: - fetch-depth: 1000 - - name: Capture Environment - if: success() || failure() - run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' - shell: pwsh - - name: Set Build Name for Non-PR - if: github.event_name != 'PullRequest' - run: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" - shell: pwsh - - uses: "./.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed" - if: env.UseAzDevOpsFeed != '' - - name: Bootstrap - if: success() - run: |- - Import-Module .\tools\ci.psm1 - Invoke-CIInstall -SkipUser - Write-Verbose -Verbose "Start Sync-PSTags" - Sync-PSTags -AddRemoteIfMissing - Write-Verbose -Verbose "End Sync-PSTags" - shell: pwsh - - name: Build - if: success() - run: |- - Import-Module .\tools\ci.psm1 - Invoke-CIBuild - shell: pwsh - - name: xUnit Tests - if: success() - continue-on-error: true - run: |- - Import-Module .\tools\ci.psm1 - Restore-PSOptions - Invoke-CIxUnit -SkipFailing - shell: pwsh diff --git a/.github/workflows/templates/test/verify_xunit.yml b/.github/workflows/templates/test/verify_xunit.yml deleted file mode 100644 index 8841b5b0c72..00000000000 --- a/.github/workflows/templates/test/verify_xunit.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Environment variables defined in a calling workflow are not accessible to this reusable workflow. Refer to the documentation for further details on this limitation. -name: vsts_ci_templates_verify_xunit -on: - workflow_call: - inputs: - pool: - required: false - default: windows-latest - type: string - jobName: - required: false - default: xunit_verify - type: string -jobs: - verify_xunit: - name: Verify xUnit Results - runs-on: ${{ inputs.pool }} - steps: - - name: checkout - uses: actions/checkout@v4.1.0 - # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). - # Ensure the workflow exists and uploads an artifact for this to use. - - name: Download build artifacts - uses: dawidd6/action-download-artifact@v3.0.0 - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - path: "${{ github.workspace }}" - repo: "${{ github.repository }}" - - name: Capture artifacts directory - continue-on-error: true - run: dir "${{ github.workspace }}\*" -Recurse - shell: pwsh - - name: Test - if: success() - run: |- - Import-Module .\tools\ci.psm1 - $xUnitTestResultsFile = "${{ github.workspace }}\xunit\xUnitTestResults.xml" - Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile - shell: pwsh diff --git a/.github/workflows/templates/test/windows.yml b/.github/workflows/templates/test/windows.yml deleted file mode 100644 index 5667e6889f4..00000000000 --- a/.github/workflows/templates/test/windows.yml +++ /dev/null @@ -1,85 +0,0 @@ -# Environment variables defined in a calling workflow are not accessible to this reusable workflow. Refer to the documentation for further details on this limitation. -name: vsts_ci_templates_windows_test -on: - workflow_call: - inputs: - pool: - required: false - default: windows-2019 - type: string - imageName: - required: false - default: PSWindows11-ARM64 - type: string - purpose: - required: false - default: '' - type: string - tagSet: - required: false - default: CI - type: string -jobs: - win_test_${{ parameters.purpose }}_${{ parameters.tagSet }}: - name: Windows Test - ${{ parameters.purpose }} - ${{ parameters.tagSet }} - runs-on: windows-latest - steps: - - name: checkout - uses: actions/checkout@v4.1.0 - - name: Install PowerShell if missing - if: "'inputs.pool' != 'windows-2019'" - run: |- - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 - $pwsh = Get-Command pwsh -ErrorAction SilentlyContinue -CommandType Application - if ($null -eq $pwsh) { - $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' - Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -outfile ./install-powershell.ps1 - ./install-powershell.ps1 -Destination $powerShellPath - $vstsCommandString = "vso[task.setvariable variable=PATH]$powerShellPath;$env:PATH" - Write-Host "sending " + $vstsCommandString - Write-Host "##$vstsCommandString" - } - shell: powershell - - name: Capture Environment - if: success() || failure() - run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' - shell: pwsh - # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). - # Ensure the workflow exists and uploads an artifact for this to use. - - name: Download Build Artifacts - uses: dawidd6/action-download-artifact@v3.0.0 - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - path: "${{ github.workspace }}" - repo: "${{ github.repository }}" - - name: Capture Artifacts Directory - continue-on-error: true - run: Get-ChildItem "${{ github.workspace }}\*" -Recurse - shell: pwsh - - name: Bootstrap - run: |- - # Remove "Program Files\dotnet" from the env variable PATH, so old SDKs won't affect us. - Write-Host "Old Path:" - Write-Host $env:Path - $dotnetPath = Join-Path $env:SystemDrive 'Program Files\dotnet' - $paths = $env:Path -split ";" | Where-Object { -not $_.StartsWith($dotnetPath) } - $env:Path = $paths -join ";" - Write-Host "New Path:" - Write-Host $env:Path - # Bootstrap - Import-Module .\tools\ci.psm1 - Invoke-CIInstall - shell: powershell - - name: Test - if: success() - run: |- - Import-Module .\build.psm1 -force - Start-PSBootstrap - Import-Module .\tools\ci.psm1 - Restore-PSOptions -PSOptionsPath '${{ github.workspace }}\build\psoptions.json' - $options = (Get-PSOptions) - $path = split-path -path $options.Output - $rootPath = split-Path -path $path - Expand-Archive -Path '${{ github.workspace }}\build\build.zip' -DestinationPath $rootPath -Force - Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' - shell: pwsh diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 10d40b1893e..674038038d8 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -43,36 +43,48 @@ env: jobs: ci_build: name: ci_build - uses: "./.github/workflows/templates/build/ci.yml" + runs-on: windows-latest + steps: + - uses: "./.github/actions/build/ci" windows_test: name: Windows Unelevated CI needs: ci_build - uses: "./.github/workflows/templates/test/windows.yml" - with: - purpose: UnelevatedPesterTests - tagSet: CI + runs-on: windows-latest + steps: + - uses: "./.github/actions/test/windows" + with: + purpose: UnelevatedPesterTests + tagSet: CI windows_test_2: name: windows Elevated CI needs: ci_build - uses: "./.github/workflows/templates/test/windows.yml" - with: - purpose: ElevatedPesterTests - tagSet: CI + runs-on: windows-latest + steps: + - uses: "./.github/actions/test/windows" + with: + purpose: ElevatedPesterTests + tagSet: CI windows_test_3: name: Windows Unelevated Others needs: ci_build - uses: "./.github/workflows/templates/test/windows.yml" - with: - purpose: UnelevatedPesterTests - tagSet: Others + runs-on: windows-latest + steps: + - uses: "./.github/actions/test/windows" + with: + purpose: UnelevatedPesterTests + tagSet: Others windows_test_4: name: Windows Elevated Others needs: ci_build - uses: "./.github/workflows/templates/test/windows.yml" - with: - purpose: ElevatedPesterTests - tagSet: Others + runs-on: windows-latest + steps: + - uses: "./.github/actions/test/windows" + with: + purpose: ElevatedPesterTests + tagSet: Others verify_xunit: name: Verify xUnit test results needs: ci_build - uses: "./.github/workflows/templates/verify_xunit.yml" + runs-on: windows-latest + steps: + - uses: "./.github/actions/test/verify_xunit" From 1986b3ab8dc864513b30d7dd67fff02699e4f449 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 12:53:30 -0800 Subject: [PATCH 17/63] move checkout before using composite actions --- .github/actions/build/ci/action.yml | 5 ---- .github/actions/test/verify_xunit/action.yml | 2 -- .github/actions/test/windows/action.yml | 2 -- .github/workflows/windows-ci.yml | 24 ++++++++++++++++++++ 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/actions/build/ci/action.yml b/.github/actions/build/ci/action.yml index 452597b9cb5..a5287729a5e 100644 --- a/.github/actions/build/ci/action.yml +++ b/.github/actions/build/ci/action.yml @@ -3,8 +3,6 @@ description: 'Builds PowerShell' runs: using: composite steps: - - name: checkout - uses: actions/checkout@v4.1.0 - name: Install PowerShell run: |- [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 @@ -18,9 +16,6 @@ runs: Write-Host "##$vstsCommandString" } shell: powershell - - uses: actions/checkout@v4.1.0 - with: - fetch-depth: 1000 - name: Capture Environment if: success() || failure() run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' diff --git a/.github/actions/test/verify_xunit/action.yml b/.github/actions/test/verify_xunit/action.yml index d7ddf16d2ce..f54f33e4575 100644 --- a/.github/actions/test/verify_xunit/action.yml +++ b/.github/actions/test/verify_xunit/action.yml @@ -4,8 +4,6 @@ description: 'Verify xUnit Results' runs: using: composite steps: - - name: checkout - uses: actions/checkout@v4.1.0 # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). # Ensure the workflow exists and uploads an artifact for this to use. - name: Download build artifacts diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 71bf4b8620c..e1ab18c831f 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -14,8 +14,6 @@ inputs: runs: using: composite steps: - - name: checkout - uses: actions/checkout@v4.1.0 - name: Install PowerShell if missing if: "'inputs.pool' != 'windows-2019'" run: |- diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 674038038d8..e34120ec027 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -45,12 +45,20 @@ jobs: name: ci_build runs-on: windows-latest steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 - uses: "./.github/actions/build/ci" windows_test: name: Windows Unelevated CI needs: ci_build runs-on: windows-latest steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 - uses: "./.github/actions/test/windows" with: purpose: UnelevatedPesterTests @@ -60,6 +68,10 @@ jobs: needs: ci_build runs-on: windows-latest steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 - uses: "./.github/actions/test/windows" with: purpose: ElevatedPesterTests @@ -69,6 +81,10 @@ jobs: needs: ci_build runs-on: windows-latest steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 - uses: "./.github/actions/test/windows" with: purpose: UnelevatedPesterTests @@ -78,6 +94,10 @@ jobs: needs: ci_build runs-on: windows-latest steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 - uses: "./.github/actions/test/windows" with: purpose: ElevatedPesterTests @@ -87,4 +107,8 @@ jobs: needs: ci_build runs-on: windows-latest steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 - uses: "./.github/actions/test/verify_xunit" From d489c6ef5b445905652d3b2545384638c2d46c6f Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 13:17:12 -0800 Subject: [PATCH 18/63] Use upload action --- .github/actions/build/ci/action.yml | 10 ++++++++++ .github/workflows/windows-ci.yml | 18 ++++++++++++------ tools/ci.psm1 | 5 +++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/actions/build/ci/action.yml b/.github/actions/build/ci/action.yml index a5287729a5e..abc4dfd6081 100644 --- a/.github/actions/build/ci/action.yml +++ b/.github/actions/build/ci/action.yml @@ -49,3 +49,13 @@ runs: Restore-PSOptions Invoke-CIxUnit -SkipFailing shell: pwsh + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: build + path: ${{ runner.workspace }}/build + - name: Upload xunit artifact + uses: actions/upload-artifact@v4 + with: + name: xunit + path: ${{ runner.workspace }}/xunit diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index e34120ec027..844589c1683 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -49,7 +49,8 @@ jobs: uses: actions/checkout@v4.1.0 with: fetch-depth: 1000 - - uses: "./.github/actions/build/ci" + - name: Build + uses: "./.github/actions/build/ci" windows_test: name: Windows Unelevated CI needs: ci_build @@ -59,7 +60,8 @@ jobs: uses: actions/checkout@v4.1.0 with: fetch-depth: 1000 - - uses: "./.github/actions/test/windows" + - name: Windows Unelevated CI + uses: "./.github/actions/test/windows" with: purpose: UnelevatedPesterTests tagSet: CI @@ -72,7 +74,8 @@ jobs: uses: actions/checkout@v4.1.0 with: fetch-depth: 1000 - - uses: "./.github/actions/test/windows" + - name: Windows Elevated CI + uses: "./.github/actions/test/windows" with: purpose: ElevatedPesterTests tagSet: CI @@ -85,7 +88,8 @@ jobs: uses: actions/checkout@v4.1.0 with: fetch-depth: 1000 - - uses: "./.github/actions/test/windows" + - name: Windows Unelevated Others + uses: "./.github/actions/test/windows" with: purpose: UnelevatedPesterTests tagSet: Others @@ -98,7 +102,8 @@ jobs: uses: actions/checkout@v4.1.0 with: fetch-depth: 1000 - - uses: "./.github/actions/test/windows" + - name: Windows Elevated Others + uses: "./.github/actions/test/windows" with: purpose: ElevatedPesterTests tagSet: Others @@ -111,4 +116,5 @@ jobs: uses: actions/checkout@v4.1.0 with: fetch-depth: 1000 - - uses: "./.github/actions/test/verify_xunit" + - name: Verify xUnit test results + uses: "./.github/actions/test/verify_xunit" diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 6628d54e043..fcfc2838e8b 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -437,6 +437,11 @@ function Push-Artifact if ($env:TF_BUILD) { # In Azure DevOps Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName;]$Path" + } elseif ($env:GITHUB_WORKFLOW -and $env:RUNNER_WORKSPACE) { + # In GitHub Actions + Join-Path -Path $env:RUNNER_WORKSPACE -ChildPath $artifactName | Copy-Item -Destination $Path -Force -Verbose + } else { + Write-Warning "Push-Artifact is not supported in this environment." } } From 2e9d794935076150754f7a38f90fd1dafe08be3b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 13:26:34 -0800 Subject: [PATCH 19/63] make the first line of each task indicate what the task does --- .github/actions/build/ci/action.yml | 3 +++ .github/actions/test/windows/action.yml | 14 -------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/actions/build/ci/action.yml b/.github/actions/build/ci/action.yml index abc4dfd6081..ab05afbafc3 100644 --- a/.github/actions/build/ci/action.yml +++ b/.github/actions/build/ci/action.yml @@ -29,6 +29,7 @@ runs: - name: Bootstrap if: success() run: |- + Write-Verbose -Verbose "Running Bootstrap..." Import-Module .\tools\ci.psm1 Invoke-CIInstall -SkipUser Write-Verbose -Verbose "Start Sync-PSTags" @@ -38,6 +39,7 @@ runs: - name: Build if: success() run: |- + Write-Verbose -Verbose "Running Build..." Import-Module .\tools\ci.psm1 Invoke-CIBuild shell: pwsh @@ -45,6 +47,7 @@ runs: if: success() continue-on-error: true run: |- + Write-Verbose -Verbose "Running xUnit tests..." Import-Module .\tools\ci.psm1 Restore-PSOptions Invoke-CIxUnit -SkipFailing diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index e1ab18c831f..9bb58b9871d 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -14,20 +14,6 @@ inputs: runs: using: composite steps: - - name: Install PowerShell if missing - if: "'inputs.pool' != 'windows-2019'" - run: |- - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 - $pwsh = Get-Command pwsh -ErrorAction SilentlyContinue -CommandType Application - if ($null -eq $pwsh) { - $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' - Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -outfile ./install-powershell.ps1 - ./install-powershell.ps1 -Destination $powerShellPath - $vstsCommandString = "vso[task.setvariable variable=PATH]$powerShellPath;$env:PATH" - Write-Host "sending " + $vstsCommandString - Write-Host "##$vstsCommandString" - } - shell: powershell - name: Capture Environment if: success() || failure() run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' From a747f4060e898f1a62546da8e798ea6a59b7868a Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 13:26:51 -0800 Subject: [PATCH 20/63] fix the job name --- .github/workflows/windows-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 844589c1683..02fcc2c3dbd 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -42,7 +42,7 @@ env: nugetMultiFeedWarnLevel: none jobs: ci_build: - name: ci_build + name: Build PowerShell runs-on: windows-latest steps: - name: checkout From 858da9f4929bd72cd0d9d24dc39b5bd70b6b670c Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 13:27:05 -0800 Subject: [PATCH 21/63] create the artifact folder --- tools/ci.psm1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index fcfc2838e8b..e2caf9c4f36 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -439,7 +439,14 @@ function Push-Artifact Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName;]$Path" } elseif ($env:GITHUB_WORKFLOW -and $env:RUNNER_WORKSPACE) { # In GitHub Actions - Join-Path -Path $env:RUNNER_WORKSPACE -ChildPath $artifactName | Copy-Item -Destination $Path -Force -Verbose + $destinationPath = Join-Path -Path $env:RUNNER_WORKSPACE -ChildPath $artifactName + + # Create the folder if it does not exist + if (!(Test-Path -Path $destinationPath)) { + $null = New-Item -ItemType Directory -Path $destinationPath -Force + } + + Copy-Item -Destination $Path -Force -Verbose } else { Write-Warning "Push-Artifact is not supported in this environment." } From f27efac9f428a0ea8978d5684d39aa8d87ec5b82 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 13:31:02 -0800 Subject: [PATCH 22/63] remove use of github token --- .github/actions/test/verify_xunit/action.yml | 1 - .github/actions/test/windows/action.yml | 1 - .github/workflows/windows-ci.yml | 2 ++ 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/test/verify_xunit/action.yml b/.github/actions/test/verify_xunit/action.yml index f54f33e4575..ce445b1723e 100644 --- a/.github/actions/test/verify_xunit/action.yml +++ b/.github/actions/test/verify_xunit/action.yml @@ -9,7 +9,6 @@ runs: - name: Download build artifacts uses: dawidd6/action-download-artifact@v3.0.0 with: - github_token: "${{ secrets.GITHUB_TOKEN }}" path: "${{ github.workspace }}" repo: "${{ github.repository }}" - name: Capture artifacts directory diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 9bb58b9871d..d25467f0fc7 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -23,7 +23,6 @@ runs: - name: Download Build Artifacts uses: dawidd6/action-download-artifact@v3.0.0 with: - github_token: "${{ secrets.GITHUB_TOKEN }}" path: "${{ github.workspace }}" repo: "${{ github.repository }}" - name: Capture Artifacts Directory diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 02fcc2c3dbd..91185e30437 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -31,6 +31,8 @@ on: - tools/WindowsCI.psm1 - "!test/common/markdown/*" - "!test/perf/*" +permissions: + contents: read env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 From 041707eb0b97bd889437392b8afe9e253324f1d8 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 13:42:02 -0800 Subject: [PATCH 23/63] add runname --- .github/workflows/windows-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 91185e30437..3309cf93c3d 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -34,6 +34,8 @@ on: permissions: contents: read +run-name: "${{ github.ref_name }} - ${{ github.run_number }}" + env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 From 52b2b76425076917737aa41c8567f75b85dfe4ca Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 13:42:10 -0800 Subject: [PATCH 24/63] fix copy --- tools/ci.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index e2caf9c4f36..9b4c939f3f6 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -446,7 +446,7 @@ function Push-Artifact $null = New-Item -ItemType Directory -Path $destinationPath -Force } - Copy-Item -Destination $Path -Force -Verbose + Copy-Item -Path $Path -Destination $destinationPath -Force -Verbose } else { Write-Warning "Push-Artifact is not supported in this environment." } From 7b45615a6019ede20eb703e543deae969e7cb018 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 13:58:31 -0800 Subject: [PATCH 25/63] switch to the github download action --- .github/actions/test/verify_xunit/action.yml | 5 +---- .github/actions/test/windows/action.yml | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/actions/test/verify_xunit/action.yml b/.github/actions/test/verify_xunit/action.yml index ce445b1723e..28983f02818 100644 --- a/.github/actions/test/verify_xunit/action.yml +++ b/.github/actions/test/verify_xunit/action.yml @@ -4,13 +4,10 @@ description: 'Verify xUnit Results' runs: using: composite steps: - # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). - # Ensure the workflow exists and uploads an artifact for this to use. - name: Download build artifacts - uses: dawidd6/action-download-artifact@v3.0.0 + uses: actions/download-artifact@v4 with: path: "${{ github.workspace }}" - repo: "${{ github.repository }}" - name: Capture artifacts directory continue-on-error: true run: dir "${{ github.workspace }}\*" -Recurse diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index d25467f0fc7..b658776adba 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -18,13 +18,10 @@ runs: if: success() || failure() run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' shell: pwsh - # This action relies on the workflow '.yml' being present in this repository (change the repository parameter if the workflow is in a different repository). - # Ensure the workflow exists and uploads an artifact for this to use. - name: Download Build Artifacts - uses: dawidd6/action-download-artifact@v3.0.0 + uses: actions/download-artifact@v4 with: path: "${{ github.workspace }}" - repo: "${{ github.repository }}" - name: Capture Artifacts Directory continue-on-error: true run: Get-ChildItem "${{ github.workspace }}\*" -Recurse From 12a5686f1daf46845154ea3aaf7c1dcb52b772d0 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 14:03:16 -0800 Subject: [PATCH 26/63] reduce verbose writes --- tools/ci.psm1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 9b4c939f3f6..f19890fbf68 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -17,8 +17,15 @@ if(Test-Path $dotNetPath) # import build into the global scope so it can be used by packaging # argumentList $true says ignore tha we may not be able to build -Import-Module (Join-Path $repoRoot 'build.psm1') -Verbose -Scope Global -ArgumentList $true -Import-Module (Join-Path $repoRoot 'tools\packaging') -Verbose -Scope Global +Write-Verbose "Importing build.psm1" -Verbose +Import-Module (Join-Path $repoRoot 'build.psm1') -Scope Global -ArgumentList $true +$buildCommands = Get-Command -Module build +Write-Verbose "Imported build.psm1 commands: $($buildCommands.Count)" -Verbose + +Write-Verbose "Importing packaging.psm1" -Verbose +Import-Module (Join-Path $repoRoot 'tools\packaging') -Scope Global +$packagingCommands = Get-Command -Module packaging +Write-Verbose "Imported packaging.psm1 commands: $($packagingCommands.Count)" -Verbose # import the windows specific functcion only in Windows PowerShell or on Windows if($PSVersionTable.PSEdition -eq 'Desktop' -or $IsWindows) From ccfd7fbb10cbc9b9e8ce6350051915b1cbafd05b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 14:03:35 -0800 Subject: [PATCH 27/63] remove dead code --- .github/actions/build/ci/action.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/actions/build/ci/action.yml b/.github/actions/build/ci/action.yml index ab05afbafc3..b77c520088c 100644 --- a/.github/actions/build/ci/action.yml +++ b/.github/actions/build/ci/action.yml @@ -3,19 +3,6 @@ description: 'Builds PowerShell' runs: using: composite steps: - - name: Install PowerShell - run: |- - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 - $pwsh = Get-Command pwsh -ErrorAction SilentlyContinue -CommandType Application - if ($null -eq $pwsh) { - $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' - Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -outfile ./install-powershell.ps1 - ./install-powershell.ps1 -Destination $powerShellPath - $vstsCommandString = "vso[task.setvariable variable=PATH]$powerShellPath;$env:PATH" - Write-Host "sending " + $vstsCommandString - Write-Host "##$vstsCommandString" - } - shell: powershell - name: Capture Environment if: success() || failure() run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' From f2aa59bd89a4fac464ade0a066c2f996539a5065 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 14:04:06 -0800 Subject: [PATCH 28/63] fix capitalization --- .github/workflows/windows-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 3309cf93c3d..e82d881686e 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -70,7 +70,7 @@ jobs: purpose: UnelevatedPesterTests tagSet: CI windows_test_2: - name: windows Elevated CI + name: Windows Elevated CI needs: ci_build runs-on: windows-latest steps: From eb0123c7b174a6fe71884afc8e31168a818d598e Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 14:46:34 -0800 Subject: [PATCH 29/63] publish the test results --- .github/actions/test/verify_xunit/action.yml | 10 +++++++++- .github/actions/test/windows/action.yml | 11 ++++++++++- .github/workflows/windows-ci.yml | 2 ++ build.psm1 | 10 ++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/actions/test/verify_xunit/action.yml b/.github/actions/test/verify_xunit/action.yml index 28983f02818..08d9594624a 100644 --- a/.github/actions/test/verify_xunit/action.yml +++ b/.github/actions/test/verify_xunit/action.yml @@ -10,7 +10,7 @@ runs: path: "${{ github.workspace }}" - name: Capture artifacts directory continue-on-error: true - run: dir "${{ github.workspace }}\*" -Recurse + run: dir "${{ github.workspace }}\xunit\*" -Recurse shell: pwsh - name: Test if: success() @@ -19,3 +19,11 @@ runs: $xUnitTestResultsFile = "${{ github.workspace }}\xunit\xUnitTestResults.xml" Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile shell: pwsh + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action/windows@v2 + if: always() + with: + files: | + ${{ github.workspace }}\xunit\xUnitTestResults.xml + check_name: ${{ runner.os }} ${{ runner.arch }} xUnit + comment_mode: failures diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index b658776adba..3f8f3da58fe 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -24,7 +24,8 @@ runs: path: "${{ github.workspace }}" - name: Capture Artifacts Directory continue-on-error: true - run: Get-ChildItem "${{ github.workspace }}\*" -Recurse + run: |- + Get-ChildItem "${{ github.workspace }}\build\*" -Recurse shell: pwsh - name: Bootstrap run: |- @@ -53,3 +54,11 @@ runs: Expand-Archive -Path '${{ github.workspace }}\build\build.zip' -DestinationPath $rootPath -Force Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' shell: pwsh + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action/windows@v2 + if: always() + with: + files: | + ${{ github.workspace }}\testResults\**\*.xml + check_name: Windows ${{ inputs.purpose }} ${{ inputs.tagSet }} + comment_mode: changes diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index e82d881686e..b113baecc04 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -33,6 +33,8 @@ on: - "!test/perf/*" permissions: contents: read + checks: write + pull-requests: write run-name: "${{ github.ref_name }} - ${{ github.run_number }}" diff --git a/build.psm1 b/build.psm1 index ba01693988b..36d5093b270 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1758,6 +1758,16 @@ function Publish-TestResults $resolvedPath = (Resolve-Path -Path $Path).ProviderPath Write-Host "##vso[artifact.upload containerfolder=testResults;artifactname=testResults]$resolvedPath" + } elseif ($env:GITHUB_WORKFLOW -and $env:RUNNER_WORKSPACE) { + # In GitHub Actions + $destinationPath = Join-Path -Path $env:RUNNER_WORKSPACE -ChildPath 'testResults' + + # Create the folder if it does not exist + if (!(Test-Path -Path $destinationPath)) { + $null = New-Item -ItemType Directory -Path $destinationPath -Force + } + + Copy-Item -Path $Path -Destination $destinationPath -Force -Verbose } } From b24e5f557b135578142979a87edf9208059417b5 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 15:16:25 -0800 Subject: [PATCH 30/63] Only publish test results as an artifact --- .github/actions/test/verify_xunit/action.yml | 10 +--------- .github/actions/test/windows/action.yml | 14 +++++--------- .github/workflows/windows-ci.yml | 2 -- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/.github/actions/test/verify_xunit/action.yml b/.github/actions/test/verify_xunit/action.yml index 08d9594624a..28983f02818 100644 --- a/.github/actions/test/verify_xunit/action.yml +++ b/.github/actions/test/verify_xunit/action.yml @@ -10,7 +10,7 @@ runs: path: "${{ github.workspace }}" - name: Capture artifacts directory continue-on-error: true - run: dir "${{ github.workspace }}\xunit\*" -Recurse + run: dir "${{ github.workspace }}\*" -Recurse shell: pwsh - name: Test if: success() @@ -19,11 +19,3 @@ runs: $xUnitTestResultsFile = "${{ github.workspace }}\xunit\xUnitTestResults.xml" Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile shell: pwsh - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action/windows@v2 - if: always() - with: - files: | - ${{ github.workspace }}\xunit\xUnitTestResults.xml - check_name: ${{ runner.os }} ${{ runner.arch }} xUnit - comment_mode: failures diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 3f8f3da58fe..1f41f357b93 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -24,8 +24,7 @@ runs: path: "${{ github.workspace }}" - name: Capture Artifacts Directory continue-on-error: true - run: |- - Get-ChildItem "${{ github.workspace }}\build\*" -Recurse + run: Get-ChildItem "${{ github.workspace }}\*" -Recurse shell: pwsh - name: Bootstrap run: |- @@ -54,11 +53,8 @@ runs: Expand-Archive -Path '${{ github.workspace }}\build\build.zip' -DestinationPath $rootPath -Force Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' shell: pwsh - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action/windows@v2 - if: always() + - name: Upload testResults artifact + uses: actions/upload-artifact@v4 with: - files: | - ${{ github.workspace }}\testResults\**\*.xml - check_name: Windows ${{ inputs.purpose }} ${{ inputs.tagSet }} - comment_mode: changes + name: ${{ inputs.purpose }}-${{ inputs.tagSet }}-testResults + path: ${{ runner.workspace }}/testResults diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index b113baecc04..e82d881686e 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -33,8 +33,6 @@ on: - "!test/perf/*" permissions: contents: read - checks: write - pull-requests: write run-name: "${{ github.ref_name }} - ${{ github.run_number }}" From bf8d948a210af8f93cd4b1bfb2f6c7b30b26b42b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 15:23:41 -0800 Subject: [PATCH 31/63] Add test reporter --- .github/actions/build/ci/action.yml | 2 +- .github/actions/test/windows/action.yml | 2 +- .github/workflows/test-report.yaml | 28 +++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-report.yaml diff --git a/.github/actions/build/ci/action.yml b/.github/actions/build/ci/action.yml index b77c520088c..8ede33fc7b8 100644 --- a/.github/actions/build/ci/action.yml +++ b/.github/actions/build/ci/action.yml @@ -47,5 +47,5 @@ runs: - name: Upload xunit artifact uses: actions/upload-artifact@v4 with: - name: xunit + name: testResults-xunit path: ${{ runner.workspace }}/xunit diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 1f41f357b93..01afddae596 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -56,5 +56,5 @@ runs: - name: Upload testResults artifact uses: actions/upload-artifact@v4 with: - name: ${{ inputs.purpose }}-${{ inputs.tagSet }}-testResults + name: testResults-pester-${{ inputs.purpose }}-${{ inputs.tagSet }} path: ${{ runner.workspace }}/testResults diff --git a/.github/workflows/test-report.yaml b/.github/workflows/test-report.yaml new file mode 100644 index 00000000000..8779fc718d5 --- /dev/null +++ b/.github/workflows/test-report.yaml @@ -0,0 +1,28 @@ +name: 'Test Report' +on: + workflow_run: + workflows: + - windows-ci + types: + - completed +permissions: + contents: read + actions: read + checks: write +jobs: + report: + runs-on: ubuntu-latest + steps: + # no reporter for xUnit tests + # - uses: dorny/test-reporter@v1 + # with: + # artifact: testResults-xunit + # name: xUnit Tests + # path: '*.xml' + # reporter: dotnet-nunit + - uses: dorny/test-reporter@v1 + with: + artifact: /testResults-pester-.*/ + name: xUnit Tests + path: '*.xml' + reporter: dotnet-nunit From 5360a8ce02ae8d22d685e0adec451fffdb901331 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 15:26:23 -0800 Subject: [PATCH 32/63] filter captures --- .github/actions/test/verify_xunit/action.yml | 4 ++-- .github/actions/test/windows/action.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/test/verify_xunit/action.yml b/.github/actions/test/verify_xunit/action.yml index 28983f02818..fccca27182f 100644 --- a/.github/actions/test/verify_xunit/action.yml +++ b/.github/actions/test/verify_xunit/action.yml @@ -10,12 +10,12 @@ runs: path: "${{ github.workspace }}" - name: Capture artifacts directory continue-on-error: true - run: dir "${{ github.workspace }}\*" -Recurse + run: dir "${{ github.workspace }}\testResults-xunit\*" -Recurse shell: pwsh - name: Test if: success() run: |- Import-Module .\tools\ci.psm1 - $xUnitTestResultsFile = "${{ github.workspace }}\xunit\xUnitTestResults.xml" + $xUnitTestResultsFile = "${{ github.workspace }}\testResults-xunit\xUnitTestResults.xml" Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile shell: pwsh diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 01afddae596..17353611aa8 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -24,7 +24,7 @@ runs: path: "${{ github.workspace }}" - name: Capture Artifacts Directory continue-on-error: true - run: Get-ChildItem "${{ github.workspace }}\*" -Recurse + run: Get-ChildItem "${{ github.workspace }}\build\*" -Recurse shell: pwsh - name: Bootstrap run: |- From a452a80c9dfb8820a8ea9fbde9bfa1ad25799b42 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 15:49:23 -0800 Subject: [PATCH 33/63] delete rebase workflow --- .github/workflows/rebase.yml | 39 ------------------------------------ 1 file changed, 39 deletions(-) delete mode 100644 .github/workflows/rebase.yml diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml deleted file mode 100644 index b6a45200eb6..00000000000 --- a/.github/workflows/rebase.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This cannot rebase workflow changes into a PR -# It also only works if the GITHUB_TOKEN has permission to push to the branch -# see: https://github.com/cirrus-actions/rebase/issues/12#issuecomment-632594995 -on: - issue_comment: - types: [created] -name: Automatic Rebase -permissions: - contents: read - -jobs: - rebase: - permissions: - contents: write # for cirrus-actions/rebase to push code to rebase - pull-requests: write # for actions/github-script to create PR comment - name: Rebase - if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') - runs-on: ubuntu-latest - steps: - - name: Checkout the latest code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 0 - - name: Post rebase started comment to pull request - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - continue-on-error: true - with: - script: | - const backport_start_body = `Started rebase: https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`; - await github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: backport_start_body - }); - - name: Automatic Rebase - uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 # 1.8 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 54b785cb3b9f532ee2e3bb923bcd3d331b8ea61f Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 15:59:36 -0800 Subject: [PATCH 34/63] assign prs --- .github/workflows/AssignPrs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/AssignPrs.yml b/.github/workflows/AssignPrs.yml index 419d704ce1d..d398cd7cffe 100644 --- a/.github/workflows/AssignPrs.yml +++ b/.github/workflows/AssignPrs.yml @@ -1,6 +1,6 @@ name: Auto Assign PR Maintainer on: - pull_request: + issues: types: [opened, edited] permissions: contents: read @@ -13,6 +13,7 @@ jobs: pull-requests: write steps: - uses: wow-actions/auto-assign@67fafa03df61d7e5f201734a2fa60d1ab111880d # v3.0.2 + if: github.event.issue.pull_request with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # using the `org/team_slug` or `/team_slug` syntax to add git team as reviewers From 9f5a3b697637153375cf0abf49472d389f2f2a3c Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 16:00:07 -0800 Subject: [PATCH 35/63] use the version of test-reporter from main --- .github/workflows/test-report.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-report.yaml b/.github/workflows/test-report.yaml index 8779fc718d5..bacc5957fd0 100644 --- a/.github/workflows/test-report.yaml +++ b/.github/workflows/test-report.yaml @@ -20,7 +20,7 @@ jobs: # name: xUnit Tests # path: '*.xml' # reporter: dotnet-nunit - - uses: dorny/test-reporter@v1 + - uses: dorny/test-reporter@main with: artifact: /testResults-pester-.*/ name: xUnit Tests From 34df27941fc458dcb199452b04008bb565e61490 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 16:02:59 -0800 Subject: [PATCH 36/63] revert this: comment out long test runs --- .github/workflows/windows-ci.yml | 56 ++++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index e82d881686e..9317d4d7268 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -55,20 +55,20 @@ jobs: fetch-depth: 1000 - name: Build uses: "./.github/actions/build/ci" - windows_test: - name: Windows Unelevated CI - needs: ci_build - runs-on: windows-latest - steps: - - name: checkout - uses: actions/checkout@v4.1.0 - with: - fetch-depth: 1000 - - name: Windows Unelevated CI - uses: "./.github/actions/test/windows" - with: - purpose: UnelevatedPesterTests - tagSet: CI + # windows_test: + # name: Windows Unelevated CI + # needs: ci_build + # runs-on: windows-latest + # steps: + # - name: checkout + # uses: actions/checkout@v4.1.0 + # with: + # fetch-depth: 1000 + # - name: Windows Unelevated CI + # uses: "./.github/actions/test/windows" + # with: + # purpose: UnelevatedPesterTests + # tagSet: CI windows_test_2: name: Windows Elevated CI needs: ci_build @@ -83,20 +83,20 @@ jobs: with: purpose: ElevatedPesterTests tagSet: CI - windows_test_3: - name: Windows Unelevated Others - needs: ci_build - runs-on: windows-latest - steps: - - name: checkout - uses: actions/checkout@v4.1.0 - with: - fetch-depth: 1000 - - name: Windows Unelevated Others - uses: "./.github/actions/test/windows" - with: - purpose: UnelevatedPesterTests - tagSet: Others + # windows_test_3: + # name: Windows Unelevated Others + # needs: ci_build + # runs-on: windows-latest + # steps: + # - name: checkout + # uses: actions/checkout@v4.1.0 + # with: + # fetch-depth: 1000 + # - name: Windows Unelevated Others + # uses: "./.github/actions/test/windows" + # with: + # purpose: UnelevatedPesterTests + # tagSet: Others windows_test_4: name: Windows Elevated Others needs: ci_build From aeecb6b18cb38ee54ad913d0af51d4d6a3fab644 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Jan 2025 16:23:39 -0800 Subject: [PATCH 37/63] skip test tools build for experimental feature testing --- tools/ci.psm1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index f19890fbf68..953a6e15d8f 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -321,7 +321,9 @@ function Invoke-CITest if ($TitlePrefix) { $title = "$TitlePrefix - $title" } - Start-PSPester @arguments -Title $title + + # We just built the test tools, we don't need to rebuild them + Start-PSPester @arguments -Title $title -SkipTestToolBuild # Fail the build, if tests failed Test-PSPesterResults -TestResultsFile $expFeatureTestResultFile From c402163e42105c5a423b5975507933ebd718ce53 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 10:37:52 -0800 Subject: [PATCH 38/63] add ignores --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index cb12a297984..25fd082477c 100644 --- a/.gitignore +++ b/.gitignore @@ -111,3 +111,7 @@ msbuild.binlog # Ignore gzip files in the manpage folder assets/manpage/*.gz + +# Ignore files and folders generated by some gh cli extensions +tmp/* +.env.local From cae902c94814652223a86fa72248636c69a9e1f9 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 10:38:09 -0800 Subject: [PATCH 39/63] switch to junit --- .github/workflows/test-report.yaml | 17 ++++++++--------- tools/ci.psm1 | 4 +++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-report.yaml b/.github/workflows/test-report.yaml index bacc5957fd0..43789765b28 100644 --- a/.github/workflows/test-report.yaml +++ b/.github/workflows/test-report.yaml @@ -13,16 +13,15 @@ jobs: report: runs-on: ubuntu-latest steps: - # no reporter for xUnit tests - # - uses: dorny/test-reporter@v1 - # with: - # artifact: testResults-xunit - # name: xUnit Tests - # path: '*.xml' - # reporter: dotnet-nunit + - uses: dorny/test-reporter@v1 + with: + artifact: testResults-xunit + name: xUnit Tests + path: '*.xml' + reporter: swift-xunit - uses: dorny/test-reporter@main with: artifact: /testResults-pester-.*/ - name: xUnit Tests + name: Pester Tests path: '*.xml' - reporter: dotnet-nunit + reporter: java-junit diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 953a6e15d8f..352bad269d8 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -231,7 +231,8 @@ function Invoke-CITest [string] $Purpose, [ValidateSet('CI', 'Others')] [string] $TagSet, - [string] $TitlePrefix + [string] $TitlePrefix, + [string]$OutputFormat = "NUnitXml" ) # Set locale correctly for Linux CIs @@ -288,6 +289,7 @@ function Invoke-CITest Terse = $true Tag = @() ExcludeTag = $ExcludeTag + 'RequireAdminOnWindows' + OutputFormat = $OutputFormat } $title = "Pester Unelevated - $TagSet" From 1a32921e7d4ffeb92112f16a3cb219ae02fc22b2 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 11:31:14 -0800 Subject: [PATCH 40/63] use junit --- .github/actions/test/windows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 17353611aa8..384b025a362 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -51,7 +51,7 @@ runs: $path = split-path -path $options.Output $rootPath = split-Path -path $path Expand-Archive -Path '${{ github.workspace }}\build\build.zip' -DestinationPath $rootPath -Force - Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' + Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' -OutputFormat JUnitXml shell: pwsh - name: Upload testResults artifact uses: actions/upload-artifact@v4 From e6895c002ff836be86564c11ea630881cda20831 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 12:32:05 -0800 Subject: [PATCH 41/63] Add logging --- tools/ci.psm1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 352bad269d8..dbfc1b4e961 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -232,9 +232,11 @@ function Invoke-CITest [ValidateSet('CI', 'Others')] [string] $TagSet, [string] $TitlePrefix, - [string]$OutputFormat = "NUnitXml" + [string] $OutputFormat = "NUnitXml" ) + Write-Verbose -Verbose "CI test: OutputFormat: $OutputFormat" + # Set locale correctly for Linux CIs Set-CorrectLocale @@ -296,6 +298,7 @@ function Invoke-CITest if ($TitlePrefix) { $title = "$TitlePrefix - $title" } + Write-Verbose -Verbose "Starting Pester with output format $($arguments.OutputFormat)" Start-PSPester @arguments -Title $title # Fail the build, if tests failed @@ -325,6 +328,7 @@ function Invoke-CITest } # We just built the test tools, we don't need to rebuild them + Write-Verbose -Verbose "Starting Pester with output format $($arguments.OutputFormat)" Start-PSPester @arguments -Title $title -SkipTestToolBuild # Fail the build, if tests failed From 784636d4b1103d6cc2609e9360570b73ed13f3b0 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 13:17:14 -0800 Subject: [PATCH 42/63] Produce crtf json --- .github/actions/test/windows/action.yml | 18 ++++++++++++++++++ .gitignore | 1 + 2 files changed, 19 insertions(+) diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 384b025a362..a588c80a7d4 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -53,8 +53,26 @@ runs: Expand-Archive -Path '${{ github.workspace }}\build\build.zip' -DestinationPath $rootPath -Force Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' -OutputFormat JUnitXml shell: pwsh + - name: Convert JUnit to CTRF + run: |- + Get-ChildItem -Path "${{ github.workspace }}/testResults/*.xml" -Recurse | ForEach-Object { + npx --yes junit-to-ctrf $_.FullName --output .crtf/$($_.BaseName).json --tool Pester --env 'Windows ${{ inputs.purpose }} ${{ inputs.tagSet }}' + } + shell: powershell + - name: Publish Test Report + uses: ctrf-io/github-test-reporter@v1 + with: + report-path: './ctrf/*.json' + if: always() - name: Upload testResults artifact + if: always() uses: actions/upload-artifact@v4 with: name: testResults-pester-${{ inputs.purpose }}-${{ inputs.tagSet }} path: ${{ runner.workspace }}/testResults + - name: Upload ctrf artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: ctrf-pester-${{ inputs.purpose }}-${{ inputs.tagSet }} + path: .crtf diff --git a/.gitignore b/.gitignore index 25fd082477c..4b59e9c5dc1 100644 --- a/.gitignore +++ b/.gitignore @@ -115,3 +115,4 @@ assets/manpage/*.gz # Ignore files and folders generated by some gh cli extensions tmp/* .env.local +.crtf/* From da5e07bca2ef1ef598c8f7069e0d2ab501391fdd Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 13:29:33 -0800 Subject: [PATCH 43/63] fix elevated path --- tools/ci.psm1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index dbfc1b4e961..7dda90f14f3 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -343,12 +343,15 @@ function Invoke-CITest OutputFile = $testResultsAdminFile Tag = @('RequireAdminOnWindows') ExcludeTag = $ExcludeTag + OutputFormat = $OutputFormat } $title = "Pester Elevated - $TagSet" if ($TitlePrefix) { $title = "$TitlePrefix - $title" } + + Write-Verbose -Verbose "Starting Pester with output format $($arguments.OutputFormat)" Start-PSPester @arguments -Title $title # Fail the build, if tests failed @@ -379,6 +382,8 @@ function Invoke-CITest if ($TitlePrefix) { $title = "$TitlePrefix - $title" } + + Write-Verbose -Verbose "Starting Pester with output format $($arguments.OutputFormat)" Start-PSPester @arguments -Title $title # Fail the build, if tests failed From 95fe4a9d0c43c629f6543ad26629a24fb4bb927b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 13:45:38 -0800 Subject: [PATCH 44/63] fix path --- .github/actions/test/windows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index a588c80a7d4..e203c5b4941 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -55,7 +55,7 @@ runs: shell: pwsh - name: Convert JUnit to CTRF run: |- - Get-ChildItem -Path "${{ github.workspace }}/testResults/*.xml" -Recurse | ForEach-Object { + Get-ChildItem -Path "${{ runner.workspace }}/testResults/*.xml" -Recurse | ForEach-Object { npx --yes junit-to-ctrf $_.FullName --output .crtf/$($_.BaseName).json --tool Pester --env 'Windows ${{ inputs.purpose }} ${{ inputs.tagSet }}' } shell: powershell From 739cc78afbeddbcbbd37d03f061fb9d5c8be12b9 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 14:08:14 -0800 Subject: [PATCH 45/63] correct ctrf path --- .github/actions/test/windows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index e203c5b4941..3549dba39f1 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -62,7 +62,7 @@ runs: - name: Publish Test Report uses: ctrf-io/github-test-reporter@v1 with: - report-path: './ctrf/*.json' + report-path: './.ctrf/*.json' if: always() - name: Upload testResults artifact if: always() From cbf89efae29b78755f869e93819029e7e8e1a690 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 14:41:47 -0800 Subject: [PATCH 46/63] fix path separators --- .github/actions/test/windows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 3549dba39f1..23f25ed648b 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -62,7 +62,7 @@ runs: - name: Publish Test Report uses: ctrf-io/github-test-reporter@v1 with: - report-path: './.ctrf/*.json' + report-path: '.\.ctrf\*.json' if: always() - name: Upload testResults artifact if: always() From d586ea2cc5cb8779f720c49cbd589cb8837b5e3d Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 14:49:59 -0800 Subject: [PATCH 47/63] make sure all refs to the .ctrf folder are actually the same --- .github/actions/test/windows/action.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 23f25ed648b..cb4bc1a43d7 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -10,6 +10,10 @@ inputs: required: false default: CI type: string + crtfFolder: + required: false + default: .ctrf + type: string runs: using: composite @@ -56,13 +60,13 @@ runs: - name: Convert JUnit to CTRF run: |- Get-ChildItem -Path "${{ runner.workspace }}/testResults/*.xml" -Recurse | ForEach-Object { - npx --yes junit-to-ctrf $_.FullName --output .crtf/$($_.BaseName).json --tool Pester --env 'Windows ${{ inputs.purpose }} ${{ inputs.tagSet }}' + npx --yes junit-to-ctrf $_.FullName --output ${{ inputs.ctrfFolder }}/$($_.BaseName).json --tool Pester --env 'Windows ${{ inputs.purpose }} ${{ inputs.tagSet }}' } shell: powershell - name: Publish Test Report uses: ctrf-io/github-test-reporter@v1 with: - report-path: '.\.ctrf\*.json' + report-path: '.\${{ inputs.ctrfFolder }}\*.json' if: always() - name: Upload testResults artifact if: always() @@ -75,4 +79,4 @@ runs: uses: actions/upload-artifact@v4 with: name: ctrf-pester-${{ inputs.purpose }}-${{ inputs.tagSet }} - path: .crtf + path: ${{ inputs.ctrfFolder }} From 819edc49d798816615127b73a43196a06700b34f Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 15:20:59 -0800 Subject: [PATCH 48/63] fix variable --- .github/actions/test/windows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index cb4bc1a43d7..6970d98ffee 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -10,7 +10,7 @@ inputs: required: false default: CI type: string - crtfFolder: + ctrfFolder: required: false default: .ctrf type: string From bf34b56871d188da81e7a832baca76cb98c480de Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 16:23:51 -0800 Subject: [PATCH 49/63] try to fix paths --- .github/actions/test/windows/action.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 6970d98ffee..6ea13e7c457 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -12,7 +12,7 @@ inputs: type: string ctrfFolder: required: false - default: .ctrf + default: ${{ github.workspace }}\ctrf type: string runs: @@ -60,20 +60,22 @@ runs: - name: Convert JUnit to CTRF run: |- Get-ChildItem -Path "${{ runner.workspace }}/testResults/*.xml" -Recurse | ForEach-Object { - npx --yes junit-to-ctrf $_.FullName --output ${{ inputs.ctrfFolder }}/$($_.BaseName).json --tool Pester --env 'Windows ${{ inputs.purpose }} ${{ inputs.tagSet }}' + npx --yes junit-to-ctrf $_.FullName --output ${{ inputs.ctrfFolder }}\$($_.BaseName).json --tool Pester --env 'Windows ${{ inputs.purpose }} ${{ inputs.tagSet }}' } shell: powershell - name: Publish Test Report uses: ctrf-io/github-test-reporter@v1 with: - report-path: '.\${{ inputs.ctrfFolder }}\*.json' + report-path: '${{ inputs.ctrfFolder }}\*.json' if: always() + - name: Upload testResults artifact if: always() uses: actions/upload-artifact@v4 with: name: testResults-pester-${{ inputs.purpose }}-${{ inputs.tagSet }} - path: ${{ runner.workspace }}/testResults + path: ${{ runner.workspace }}\testResults + - name: Upload ctrf artifact if: always() uses: actions/upload-artifact@v4 From d1d214c1e17fac204d6de4bffbcc3da7227edcec Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 17:02:52 -0800 Subject: [PATCH 50/63] github-test-reporter only takes / as directory separators --- .github/actions/test/windows/action.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 6ea13e7c457..68151252e53 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -12,7 +12,7 @@ inputs: type: string ctrfFolder: required: false - default: ${{ github.workspace }}\ctrf + default: ctrf type: string runs: @@ -30,7 +30,9 @@ runs: continue-on-error: true run: Get-ChildItem "${{ github.workspace }}\build\*" -Recurse shell: pwsh + - name: Bootstrap + shell: powershell run: |- # Remove "Program Files\dotnet" from the env variable PATH, so old SDKs won't affect us. Write-Host "Old Path:" @@ -43,7 +45,7 @@ runs: # Bootstrap Import-Module .\tools\ci.psm1 Invoke-CIInstall - shell: powershell + - name: Test if: success() run: |- @@ -57,23 +59,26 @@ runs: Expand-Archive -Path '${{ github.workspace }}\build\build.zip' -DestinationPath $rootPath -Force Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' -OutputFormat JUnitXml shell: pwsh + - name: Convert JUnit to CTRF run: |- Get-ChildItem -Path "${{ runner.workspace }}/testResults/*.xml" -Recurse | ForEach-Object { - npx --yes junit-to-ctrf $_.FullName --output ${{ inputs.ctrfFolder }}\$($_.BaseName).json --tool Pester --env 'Windows ${{ inputs.purpose }} ${{ inputs.tagSet }}' + npx --yes junit-to-ctrf $_.FullName --output .\${{ inputs.ctrfFolder }}\$($_.BaseName).json --tool Pester --env 'Windows ${{ inputs.purpose }} ${{ inputs.tagSet }}' } shell: powershell + + # this task only takes / as directory separators - name: Publish Test Report uses: ctrf-io/github-test-reporter@v1 with: - report-path: '${{ inputs.ctrfFolder }}\*.json' + report-path: './${{ inputs.ctrfFolder }}/*.json' if: always() - name: Upload testResults artifact if: always() uses: actions/upload-artifact@v4 with: - name: testResults-pester-${{ inputs.purpose }}-${{ inputs.tagSet }} + name: junit-pester-${{ inputs.purpose }}-${{ inputs.tagSet }} path: ${{ runner.workspace }}\testResults - name: Upload ctrf artifact From 5d8dcca123aaaaa8827fb4c2ba8dfa5cb7ae90fe Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 17:03:55 -0800 Subject: [PATCH 51/63] remove unused workflow --- .github/workflows/test-report.yaml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 .github/workflows/test-report.yaml diff --git a/.github/workflows/test-report.yaml b/.github/workflows/test-report.yaml deleted file mode 100644 index 43789765b28..00000000000 --- a/.github/workflows/test-report.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: 'Test Report' -on: - workflow_run: - workflows: - - windows-ci - types: - - completed -permissions: - contents: read - actions: read - checks: write -jobs: - report: - runs-on: ubuntu-latest - steps: - - uses: dorny/test-reporter@v1 - with: - artifact: testResults-xunit - name: xUnit Tests - path: '*.xml' - reporter: swift-xunit - - uses: dorny/test-reporter@main - with: - artifact: /testResults-pester-.*/ - name: Pester Tests - path: '*.xml' - reporter: java-junit From 74a42dcf3e24c21e0cd7d12028c31786de6f25c0 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 17:30:05 -0800 Subject: [PATCH 52/63] make it fail on failure --- .github/actions/test/windows/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 68151252e53..ec90f6a1049 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -72,6 +72,7 @@ runs: uses: ctrf-io/github-test-reporter@v1 with: report-path: './${{ inputs.ctrfFolder }}/*.json' + exit-on-fail: true if: always() - name: Upload testResults artifact From 5d179da86aa5f9424b7bfea071d947c7515c5add Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 17:30:22 -0800 Subject: [PATCH 53/63] run unelevated tests too --- .github/workflows/windows-ci.yml | 56 ++++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 9317d4d7268..e82d881686e 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -55,20 +55,20 @@ jobs: fetch-depth: 1000 - name: Build uses: "./.github/actions/build/ci" - # windows_test: - # name: Windows Unelevated CI - # needs: ci_build - # runs-on: windows-latest - # steps: - # - name: checkout - # uses: actions/checkout@v4.1.0 - # with: - # fetch-depth: 1000 - # - name: Windows Unelevated CI - # uses: "./.github/actions/test/windows" - # with: - # purpose: UnelevatedPesterTests - # tagSet: CI + windows_test: + name: Windows Unelevated CI + needs: ci_build + runs-on: windows-latest + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 + - name: Windows Unelevated CI + uses: "./.github/actions/test/windows" + with: + purpose: UnelevatedPesterTests + tagSet: CI windows_test_2: name: Windows Elevated CI needs: ci_build @@ -83,20 +83,20 @@ jobs: with: purpose: ElevatedPesterTests tagSet: CI - # windows_test_3: - # name: Windows Unelevated Others - # needs: ci_build - # runs-on: windows-latest - # steps: - # - name: checkout - # uses: actions/checkout@v4.1.0 - # with: - # fetch-depth: 1000 - # - name: Windows Unelevated Others - # uses: "./.github/actions/test/windows" - # with: - # purpose: UnelevatedPesterTests - # tagSet: Others + windows_test_3: + name: Windows Unelevated Others + needs: ci_build + runs-on: windows-latest + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 + - name: Windows Unelevated Others + uses: "./.github/actions/test/windows" + with: + purpose: UnelevatedPesterTests + tagSet: Others windows_test_4: name: Windows Elevated Others needs: ci_build From 06b838a37247fc47def7f7aead04ecbb104cbe9c Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 17:59:22 -0800 Subject: [PATCH 54/63] update report format --- .github/actions/test/windows/action.yml | 17 ++++ results.xml | 107 ++++++++++++++++++++++++ results2.xml | 24 ++++++ 3 files changed, 148 insertions(+) create mode 100644 results.xml create mode 100644 results2.xml diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index ec90f6a1049..573be6fc475 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -73,6 +73,23 @@ runs: with: report-path: './${{ inputs.ctrfFolder }}/*.json' exit-on-fail: true + summary-report: true + test-report: false + test-list-report: false + failed-report: false + fail-rate-report: false + flaky-report: false + flaky-rate-report: false + failed-folded-report: false + previous-results-report: false + ai-report: false + skipped-report: false + suite-folded-report: false + suite-list-report: false + pull-request-report: false + commit-report: false + custom-report: false + if: always() - name: Upload testResults artifact diff --git a/results.xml b/results.xml new file mode 100644 index 00000000000..334bf51ce1c --- /dev/null +++ b/results.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From a96a570afc09c247ad2b31471291e3fb6f81a242 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 17:59:57 -0800 Subject: [PATCH 55/63] try ai report --- .github/actions/test/windows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 573be6fc475..fb1c3675262 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -82,7 +82,7 @@ runs: flaky-rate-report: false failed-folded-report: false previous-results-report: false - ai-report: false + ai-report: true skipped-report: false suite-folded-report: false suite-list-report: false From 96fb1e54d5832f7f55519043462623f3daf96a66 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Jan 2025 18:02:36 -0800 Subject: [PATCH 56/63] update report format --- .github/actions/test/windows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index fb1c3675262..6cb5cbc1d74 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -80,7 +80,7 @@ runs: fail-rate-report: false flaky-report: false flaky-rate-report: false - failed-folded-report: false + failed-folded-report: true previous-results-report: false ai-report: true skipped-report: false From 1cd3922d9e3aa39d7f5c8626dea45f1f1325c6d5 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 09:29:54 -0800 Subject: [PATCH 57/63] Update .github/actions/build/ci/action.yml --- .github/actions/build/ci/action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/actions/build/ci/action.yml b/.github/actions/build/ci/action.yml index 8ede33fc7b8..90968d81cfe 100644 --- a/.github/actions/build/ci/action.yml +++ b/.github/actions/build/ci/action.yml @@ -11,8 +11,6 @@ runs: if: github.event_name != 'PullRequest' run: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" shell: pwsh - - uses: "./.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed" - if: env.UseAzDevOpsFeed != '' - name: Bootstrap if: success() run: |- From 4907db0212f845ee66611183d7c6eb0b28736c7c Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 09:30:13 -0800 Subject: [PATCH 58/63] Delete .github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml --- .../action.yml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml diff --git a/.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml b/.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml deleted file mode 100644 index 0d27a741e65..00000000000 --- a/.github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: tools_releaseBuild_azureDevOps_templates_insert_nuget_config_azfeed -inputs: - repoRoot: - required: false - default: "$(REPOROOT)" -runs: - using: composite - steps: - - uses: "./.github/actions/pipelines_templates_insert_nuget_config_azfeed" - with: - repoRoot: "${{ env.REPOROOT }}" From d4fe4d4b4c9d5e2bd63a8217710a88f00cf67e76 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 09:30:28 -0800 Subject: [PATCH 59/63] Delete .github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml --- .../action.yml | 59 ------------------- 1 file changed, 59 deletions(-) delete mode 100644 .github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml diff --git a/.github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml b/.github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml deleted file mode 100644 index 9b5565af000..00000000000 --- a/.github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: pipelines_templates_insert_nuget_config_azfeed -inputs: - repoRoot: - required: false - default: "$(REPOROOT)" - ob_restore_phase: - required: false - default: true - type: boolean -runs: - using: composite - steps: - - name: Install Azure Artifacts Credential Provider - uses: actions/setup-dotnet@v4.0.0 - env: - NUGET_AUTH_TOKEN: "${{ secrets.NUGET_AUTH_TOKEN }}" - NUGET_FEED_URL: "${{ env.NUGET_FEED_URL }}" - with: - source-url: "${{ env.NUGET_FEED_URL }}" - - name: Switch to production Azure DevOps feed for all nuget.configs - if: "(success() || failure()) && env.UseAzDevOpsFeed != ''" - env: - NUGETCONFIGDIR: "${{ inputs.repoRoot }}/src/Modules" - OB_RESTORE_PHASE: "${{ inputs.ob_restore_phase }}" - run: |- - try { - $configPath = "${env:NugetConfigDir}/nuget.config" - Import-Module ${{ inputs.repoRoot }}/build.psm1 -Force - - Write-Verbose -Verbose "Running: Switch-PSNugetConfig -Source Private -UserName '${{ env.AzDevopsFeedUserNameKVPAT }}' -ClearTextPAT '${{ env.powershellPackageReadPat }}'" - Switch-PSNugetConfig -Source Private -UserName '${{ env.AzDevopsFeedUserNameKVPAT }}' -ClearTextPAT '${{ env.powershellPackageReadPat }}' - - if(-not (Test-Path $configPath)) - { - throw "nuget.config is not created" - } - } - catch { - Get-Error - throw - } - shell: pwsh - - name: Capture all nuget.config files - if: "(success() || failure()) && env.UseAzDevOpsFeed != ''" - env: - OB_RESTORE_PHASE: "${{ inputs.ob_restore_phase }}" - run: |- - Get-ChildItem ${{ inputs.repoRoot }}/nuget.config -Recurse | Foreach-Object { - Write-Verbose -Verbose "--- START $($_.fullname) ---" - get-content $_.fullname | Out-String -width 9999 -Stream | write-Verbose -Verbose - Write-Verbose -Verbose "--- END $($_.fullname) ---" - } - shell: pwsh - - name: Capture VSS* Environment - if: "(success() || failure()) && env.UseAzDevOpsFeed != ''" - env: - OB_RESTORE_PHASE: "${{ inputs.ob_restore_phase }}" - run: Get-ChildItem -Path env:VSS* | Out-String -width 9999 -Stream | write-Verbose -Verbose - shell: pwsh From 45d4f78ea6220989ee80b24b01f7e455ac41e94f Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 09:30:46 -0800 Subject: [PATCH 60/63] Delete results2.xml --- results2.xml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 results2.xml diff --git a/results2.xml b/results2.xml deleted file mode 100644 index b6f31bbf9ce..00000000000 --- a/results2.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 34d52c9f6c35c797b88422a4eeda6f23b5ece3b9 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 09:31:02 -0800 Subject: [PATCH 61/63] Delete results.xml --- results.xml | 107 ---------------------------------------------------- 1 file changed, 107 deletions(-) delete mode 100644 results.xml diff --git a/results.xml b/results.xml deleted file mode 100644 index 334bf51ce1c..00000000000 --- a/results.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -