From 82402d9de42681cada09eab5fb7bf93ad2820a58 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 12:39:01 -0800 Subject: [PATCH 01/28] Add workflow powershell/PowerShell-CI-linux --- .github/workflows/powershell-ci-linux.yml | 180 ++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 .github/workflows/powershell-ci-linux.yml diff --git a/.github/workflows/powershell-ci-linux.yml b/.github/workflows/powershell-ci-linux.yml new file mode 100644 index 00000000000..5bdaf9aa07c --- /dev/null +++ b/.github/workflows/powershell-ci-linux.yml @@ -0,0 +1,180 @@ +name: powershell/PowerShell-CI-linux +on: + workflow_dispatch: + inputs: + ContainerPattern: + description: | + Pattern to match JobName of the container. + Update this to force a container. + `.` will match everything + default: "." + type: string + required: false + push: + branches: + - master + - release* + - feature* + paths: + - "*" + - "!.vsts-ci/misc-analysis.yml" + - "!.github/ISSUE_TEMPLATE/*" + - "!.github/workflows/*" + - "!.dependabot/config.yml" + - "!.pipelines/*" + - "!test/perf/*" + pull_request: + branches: + - master + - release* + - feature* + paths: + - "*" + - "!.dependabot/config.yml" + - "!.github/ISSUE_TEMPLATE/*" + - "!.github/workflows/*" + - "!.vsts-ci/misc-analysis.yml" + - "!.vsts-ci/windows.yml" + - "!.vsts-ci/windows/*" + - "!tools/cgmanifest.json" + - "!LICENSE.txt" + - "!test/common/markdown/*" + - "!test/perf/*" + - "!tools/releaseBuild/*" + - "!tools/install*" + - "!tools/releaseBuild/azureDevOps/templates/*" + - "!README.md" + - "!.spelling" + - "!.pipelines/*" +env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + FORCE_FEATURE: 'False' + FORCE_PACKAGE: 'False' + NUGET_KEY: none + POWERSHELL_TELEMETRY_OPTOUT: 1 + __SuppressAnsiEscapeSequences: 1 + nugetMultiFeedWarnLevel: none + system_debug: 'false' +jobs: + vsts_ci_templates_ci_build: + name: vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_ci_build.yml" + with: + pool: ubuntu-20.04 + jobName: linux_build + displayName: linux Build + vsts_ci_templates_nix_test: + name: vsts_ci_templates_nix_test + needs: vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_nix_test.yml" + with: + pool: ubuntu-20.04 + purpose: UnelevatedPesterTests + tagSet: CI + name: Ubuntu + vsts_ci_templates_nix_test_2: + name: vsts_ci_templates_nix_test_2 + needs: vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_nix_test.yml" + with: + pool: ubuntu-20.04 + purpose: ElevatedPesterTests + tagSet: CI + name: Ubuntu + vsts_ci_templates_nix_test_3: + name: vsts_ci_templates_nix_test_3 + needs: vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_nix_test.yml" + with: + pool: ubuntu-20.04 + purpose: UnelevatedPesterTests + tagSet: Others + name: Ubuntu + vsts_ci_templates_nix_test_4: + name: vsts_ci_templates_nix_test_4 + needs: vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_nix_test.yml" + with: + pool: ubuntu-20.04 + purpose: ElevatedPesterTests + tagSet: Others + name: Ubuntu + 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" + with: + pool: ubuntu-20.04 + TestContainer-getContainerJob: + name: Choose a container + needs: + - vsts_ci_templates_ci_build + runs-on: ubuntu-20.04 + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + - uses: actions/checkout@v4.1.0 + - uses: actions/checkout@v4.1.0 + with: + repository: PowerShell/PowerShell-Docker + ref: master + token: "${{ secrets.CHECKOUT_TOKEN }}" + - name: Initialize Container Stage + id: getContainerTask + continue-on-error: true + run: |- + # Initialize container test stage + Import-Module ./PowerShell/tools/ci.psm1 + Invoke-InitializeContainerStage -ContainerPattern '${{ parameters.ContainerPattern }}' + shell: pwsh + vsts_ci_templates_test_nix_container_test: + name: vsts_ci_templates_test_nix_container_test + needs: + - TestContainer-getContainerJob + - vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_test_nix_container_test.yml" + with: + pool: ubuntu-20.04 + purpose: UnelevatedPesterTests + tagSet: CI + name: container + vsts_ci_templates_test_nix_container_test_2: + name: vsts_ci_templates_test_nix_container_test_2 + needs: + - TestContainer-getContainerJob + - vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_test_nix_container_test.yml" + with: + pool: ubuntu-20.04 + purpose: ElevatedPesterTests + tagSet: CI + name: container + vsts_ci_templates_test_nix_container_test_3: + name: vsts_ci_templates_test_nix_container_test_3 + needs: + - TestContainer-getContainerJob + - vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_test_nix_container_test.yml" + with: + pool: ubuntu-20.04 + purpose: UnelevatedPesterTests + tagSet: Others + name: container + vsts_ci_templates_test_nix_container_test_4: + name: vsts_ci_templates_test_nix_container_test_4 + needs: + - TestContainer-getContainerJob + - vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_templates_test_nix_container_test.yml" + with: + pool: ubuntu-20.04 + purpose: ElevatedPesterTests + tagSet: Others + name: container + vsts_ci_linux_templates_packaging: + name: vsts_ci_linux_templates_packaging + needs: vsts_ci_templates_ci_build + uses: "./.github/workflows/vsts_ci_linux_templates_packaging.yml" + with: + pool: ubuntu-20.04 From f4019c6aee55d01c058cabfbe5dde55152f6e83c Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 12:39:03 -0800 Subject: [PATCH 02/28] 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 7cee8e200b614b57f9370de049224986ba41fd0d Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 12:39:04 -0800 Subject: [PATCH 03/28] 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 b4d985fdfc6d500a4871b6b365706ac37a5f0ac2 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 12:39:06 -0800 Subject: [PATCH 04/28] Add composite action vsts_ci_templates_test_nix_test_steps --- .../action.yml | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/actions/vsts_ci_templates_test_nix_test_steps/action.yml diff --git a/.github/actions/vsts_ci_templates_test_nix_test_steps/action.yml b/.github/actions/vsts_ci_templates_test_nix_test_steps/action.yml new file mode 100644 index 00000000000..d1fd6454649 --- /dev/null +++ b/.github/actions/vsts_ci_templates_test_nix_test_steps/action.yml @@ -0,0 +1,80 @@ +name: vsts_ci_templates_test_nix_test_steps +inputs: + purpose: + required: false + default: '' + type: string + tagSet: + required: false + default: CI + type: string + buildName: + required: false + default: Ubuntu + type: string +runs: + using: composite + steps: + - 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: |- + Import-Module .\tools\ci.psm1 + Invoke-CIInstall -SkipUser + shell: pwsh + - name: Extract Files + uses: actions/github-script@v7.0.0 + env: + DESTINATION_FOLDER: "${{ github.workspace }}/bins" + ARCHIVE_FILE_PATTERNS: "${{ github.workspace }}/build/build.zip" + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const target = path.resolve(process.env.DESTINATION_FOLDER) + const patterns = process.env.ARCHIVE_FILE_PATTERNS + const globber = await glob.create(patterns) + await io.mkdirP(path.dirname(target)) + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + await exec.exec(`7z x ${file} -o${target} -aoa`) + } + - name: Fix permissions + continue-on-error: true + run: |- + find "${{ github.workspace }}/bins" -type d -exec chmod +rwx {} \; + find "${{ github.workspace }}/bins" -type f -exec chmod +rw {} \; + shell: bash + - name: Capture Extracted Build ZIP + continue-on-error: true + run: Get-ChildItem "${{ github.workspace }}\bins\*" -Recurse -ErrorAction SilentlyContinue + shell: pwsh + - name: Test + if: success() + run: |- + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '${{ github.workspace }}\build\psoptions.json' + $options = (Get-PSOptions) + $rootPath = '${{ github.workspace }}\bins' + $originalRootPath = Split-Path -path $options.Output + $path = Join-Path -path $rootPath -ChildPath (split-path -leaf -path $originalRootPath) + $pwshPath = Join-Path -path $path -ChildPath 'pwsh' + chmod a+x $pwshPath + $options.Output = $pwshPath + Set-PSOptions $options + Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' -TitlePrefix '${{ inputs.buildName }}' + shell: pwsh \ No newline at end of file From 86ba3fcdce11acfa209eb275771ae76c92bcf720 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 12:39:07 -0800 Subject: [PATCH 05/28] 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 046dc8d8b6ac30b551df7cdcb92e4973132b9f11 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 12:39:08 -0800 Subject: [PATCH 06/28] Add reusable workflow vsts_ci_templates_nix_test --- .../workflows/vsts_ci_templates_nix_test.yml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/vsts_ci_templates_nix_test.yml diff --git a/.github/workflows/vsts_ci_templates_nix_test.yml b/.github/workflows/vsts_ci_templates_nix_test.yml new file mode 100644 index 00000000000..000862fb6a1 --- /dev/null +++ b/.github/workflows/vsts_ci_templates_nix_test.yml @@ -0,0 +1,32 @@ +# 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_nix_test +on: + workflow_call: + inputs: + pool: + required: false + default: macOS-latest + type: string + purpose: + required: false + default: '' + type: string + tagSet: + required: false + default: CI + type: string + name: + required: false + default: mac + type: string +jobs: + ${{ parameters.name }}_test_${{ parameters.purpose }}_${{ parameters.tagSet }}: + name: ${{ parameters.name }} Test - ${{ parameters.purpose }} - ${{ parameters.tagSet }} + runs-on: ${{ inputs.pool }} + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + - uses: "./.github/actions/vsts_ci_templates_test_nix_test_steps" + with: + purpose: "${{ inputs.purpose }}" + tagSet: "${{ inputs.tagSet }}" From 348de0b18297e86a008fe2dcc61fc11c2517cebb Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 12:39:09 -0800 Subject: [PATCH 07/28] 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 ff6cdb44ccaddc7d66ebb9ecdfbfb3eb73ab1a1b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 12:39:10 -0800 Subject: [PATCH 08/28] Add reusable workflow vsts_ci_templates_test_nix_container_test --- ...s_ci_templates_test_nix_container_test.yml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/vsts_ci_templates_test_nix_container_test.yml diff --git a/.github/workflows/vsts_ci_templates_test_nix_container_test.yml b/.github/workflows/vsts_ci_templates_test_nix_container_test.yml new file mode 100644 index 00000000000..ae3c656f8f1 --- /dev/null +++ b/.github/workflows/vsts_ci_templates_test_nix_container_test.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_test_nix_container_test +on: + workflow_call: + inputs: + pool: + required: false + default: macOS-latest + type: string + purpose: + required: false + default: '' + type: string + tagSet: + required: false + default: CI + type: string + name: + required: false + default: mac + type: string +jobs: + ${{ parameters.name }}_test_${{ parameters.purpose }}_${{ parameters.tagSet }}: + name: ${{ parameters.name }} Test - ${{ parameters.purpose }} - ${{ parameters.tagSet }} + runs-on: ${{ inputs.pool }} + container: + image: "$[ variables.getContainerJob ]" + env: + __INCONTAINER: 1 + containerBuildName: UPDATE ME + getContainerJob: UPDATE ME + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + - uses: "./.github/actions/vsts_ci_templates_test_nix_test_steps" + with: + purpose: "${{ inputs.purpose }}" + tagSet: "${{ inputs.tagSet }}" + buildName: "${{ env.containerBuildName }}" From c2384da47a68e669290a59d2eb8884537a917a44 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 12:39:11 -0800 Subject: [PATCH 09/28] Add reusable workflow vsts_ci_linux_templates_packaging --- .../vsts_ci_linux_templates_packaging.yml | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 .github/workflows/vsts_ci_linux_templates_packaging.yml diff --git a/.github/workflows/vsts_ci_linux_templates_packaging.yml b/.github/workflows/vsts_ci_linux_templates_packaging.yml new file mode 100644 index 00000000000..52c1e1c20b0 --- /dev/null +++ b/.github/workflows/vsts_ci_linux_templates_packaging.yml @@ -0,0 +1,105 @@ +# 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_linux_templates_packaging +on: + workflow_call: + inputs: + pool: + required: false + default: ubuntu-20.04 + type: string + name: + required: false + default: Linux + type: string +jobs: + ${{ parameters.name }}_packaging: + name: ${{ parameters.name }} packaging + runs-on: ${{ inputs.pool }} + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + - 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: |- + Import-Module .\build.psm1 + Start-PSBootstrap -Package + shell: pwsh + - name: Capture Artifacts Directory + continue-on-error: true + run: Import-Module ./build.psm1 + shell: pwsh + - name: Extract Files + uses: actions/github-script@v7.0.0 + env: + DESTINATION_FOLDER: "${{ github.workspace }}/bins" + ARCHIVE_FILE_PATTERNS: "${{ github.workspace }}/build/build.zip" + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const target = path.resolve(process.env.DESTINATION_FOLDER) + const patterns = process.env.ARCHIVE_FILE_PATTERNS + const globber = await glob.create(patterns) + await io.mkdirP(path.dirname(target)) + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + await exec.exec(`7z x ${file} -o${target} -aoa`) + } + - name: Fix permissions + continue-on-error: true + run: |- + find "${{ github.workspace }}/bins" -type d -exec chmod +rwx {} \; + find "${{ github.workspace }}/bins" -type f -exec chmod +rw {} \; + shell: bash + - name: Capture Extracted Build ZIP + continue-on-error: true + run: Get-ChildItem "${{ github.workspace }}\bins\*" -Recurse -ErrorAction SilentlyContinue + shell: pwsh + - name: Packaging Tests + if: success() + run: |- + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '${{ github.workspace }}\build\psoptions.json' + $options = (Get-PSOptions) + $rootPath = '${{ github.workspace }}\bins' + $originalRootPath = Split-Path -path $options.Output + $path = Join-Path -path $rootPath -ChildPath (split-path -leaf -path $originalRootPath) + $pwshPath = Join-Path -path $path -ChildPath 'pwsh' + chmod a+x $pwshPath + $options.Output = $pwshPath + Set-PSOptions $options + Invoke-CIFinish + shell: pwsh + - name: Upload packages + run: |- + Get-ChildItem "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.deb" -Recurse | ForEach-Object { + $packagePath = $_.FullName + Write-Host "Uploading $packagePath" + Write-Host "##vso[artifact.upload containerfolder=deb;artifactname=deb]$packagePath" + } + Get-ChildItem "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.rpm" -Recurse | ForEach-Object { + $packagePath = $_.FullName + Write-Host "Uploading $packagePath" + Write-Host "##vso[artifact.upload containerfolder=rpm;artifactname=rpm]$packagePath" + } + Get-ChildItem "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.tar.gz" -Recurse | ForEach-Object { + $packagePath = $_.FullName + Write-Host "Uploading $packagePath" + Write-Host "##vso[artifact.upload containerfolder=rpm;artifactname=rpm]$packagePath" + } + shell: pwsh From ccdc1bd5cecd85822ead79f3a8666eb668563a6d Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 13:07:04 -0800 Subject: [PATCH 10/28] convert to use composite actions --- .../actions/test/linux-packaging/action.yml | 92 +++++++++ .github/actions/test/nix/action.yml | 133 +++++++++++++ .github/workflows/linux-ci.yml | 140 ++++++++++++++ .github/workflows/powershell-ci-linux.yml | 180 ------------------ .../workflows/vsts_ci_templates_ci_build.yml | 77 -------- .../workflows/vsts_ci_templates_nix_test.yml | 32 ---- ...s_ci_templates_test_nix_container_test.yml | 39 ---- .../vsts_ci_templates_verify_xunit.yml | 39 ---- 8 files changed, 365 insertions(+), 367 deletions(-) create mode 100644 .github/actions/test/linux-packaging/action.yml create mode 100644 .github/actions/test/nix/action.yml create mode 100644 .github/workflows/linux-ci.yml delete mode 100644 .github/workflows/powershell-ci-linux.yml delete mode 100644 .github/workflows/vsts_ci_templates_ci_build.yml delete mode 100644 .github/workflows/vsts_ci_templates_nix_test.yml delete mode 100644 .github/workflows/vsts_ci_templates_test_nix_container_test.yml delete mode 100644 .github/workflows/vsts_ci_templates_verify_xunit.yml diff --git a/.github/actions/test/linux-packaging/action.yml b/.github/actions/test/linux-packaging/action.yml new file mode 100644 index 00000000000..a42b6327dea --- /dev/null +++ b/.github/actions/test/linux-packaging/action.yml @@ -0,0 +1,92 @@ +name: linux_packaging +description: 'Test very basic Linux packaging' + + +runs: + using: composite + steps: + - name: Capture Environment + if: success() || failure() + run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' + shell: pwsh + - name: Download Build Artifacts + uses: actions/download-artifact@v4 + with: + path: "${{ github.workspace }}" + - name: Capture Artifacts Directory + continue-on-error: true + run: Get-ChildItem "${{ github.workspace }}/build/*" -Recurse + shell: pwsh + + - name: Bootstrap + run: |- + Import-Module ./build.psm1 + Start-PSBootstrap -Package + shell: pwsh + - name: Capture Artifacts Directory + continue-on-error: true + run: Import-Module ./build.psm1 + shell: pwsh + - name: Extract Files + uses: actions/github-script@v7.0.0 + env: + DESTINATION_FOLDER: "${{ github.workspace }}/bins" + ARCHIVE_FILE_PATTERNS: "${{ github.workspace }}/build/build.zip" + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const target = path.resolve(process.env.DESTINATION_FOLDER) + const patterns = process.env.ARCHIVE_FILE_PATTERNS + const globber = await glob.create(patterns) + await io.mkdirP(path.dirname(target)) + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + await exec.exec(`7z x ${file} -o${target} -aoa`) + } + - name: Fix permissions + continue-on-error: true + run: |- + find "${{ github.workspace }}/bins" -type d -exec chmod +rwx {} \; + find "${{ github.workspace }}/bins" -type f -exec chmod +rw {} \; + shell: bash + - name: Capture Extracted Build ZIP + continue-on-error: true + run: Get-ChildItem "${{ github.workspace }}/bins/*" -Recurse -ErrorAction SilentlyContinue + shell: pwsh + - name: Packaging Tests + if: success() + run: |- + Import-Module ./tools/ci.psm1 + Restore-PSOptions -PSOptionsPath '${{ github.workspace }}/build/psoptions.json' + $options = (Get-PSOptions) + $rootPath = '${{ github.workspace }}/bins' + $originalRootPath = Split-Path -path $options.Output + $path = Join-Path -path $rootPath -ChildPath (split-path -leaf -path $originalRootPath) + $pwshPath = Join-Path -path $path -ChildPath 'pwsh' + chmod a+x $pwshPath + $options.Output = $pwshPath + Set-PSOptions $options + Invoke-CIFinish + shell: pwsh + - name: Upload packages + run: |- + Get-ChildItem "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}/*.deb" -Recurse | ForEach-Object { + $packagePath = $_.FullName + Write-Host "Uploading $packagePath" + Write-Host "##vso[artifact.upload containerfolder=deb;artifactname=deb]$packagePath" + } + Get-ChildItem "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}/*.rpm" -Recurse | ForEach-Object { + $packagePath = $_.FullName + Write-Host "Uploading $packagePath" + Write-Host "##vso[artifact.upload containerfolder=rpm;artifactname=rpm]$packagePath" + } + Get-ChildItem "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}/*.tar.gz" -Recurse | ForEach-Object { + $packagePath = $_.FullName + Write-Host "Uploading $packagePath" + Write-Host "##vso[artifact.upload containerfolder=rpm;artifactname=rpm]$packagePath" + } + shell: pwsh + + + diff --git a/.github/actions/test/nix/action.yml b/.github/actions/test/nix/action.yml new file mode 100644 index 00000000000..c573f803800 --- /dev/null +++ b/.github/actions/test/nix/action.yml @@ -0,0 +1,133 @@ +name: nix_test +description: 'Test PowerShell on non-Windows platforms' + +inputs: + purpose: + required: false + default: '' + type: string + tagSet: + required: false + default: CI + type: string + ctrfFolder: + required: false + default: ctrf + type: string + +runs: + using: composite + steps: + - name: Capture Environment + if: success() || failure() + run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose' + shell: pwsh + - name: Download Build Artifacts + uses: actions/download-artifact@v4 + with: + path: "${{ github.workspace }}" + - name: Capture Artifacts Directory + continue-on-error: true + run: Get-ChildItem "${{ github.workspace }}/build/*" -Recurse + shell: pwsh + + - name: Bootstrap + shell: powershell + run: |- + Import-Module ./tools/ci.psm1 + Invoke-CIInstall -SkipUser + + - name: Extract Files + uses: actions/github-script@v7.0.0 + env: + DESTINATION_FOLDER: "${{ github.workspace }}/bins" + ARCHIVE_FILE_PATTERNS: "${{ github.workspace }}/build/build.zip" + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const target = path.resolve(process.env.DESTINATION_FOLDER) + const patterns = process.env.ARCHIVE_FILE_PATTERNS + const globber = await glob.create(patterns) + await io.mkdirP(path.dirname(target)) + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + await exec.exec(`7z x ${file} -o${target} -aoa`) + } + + - name: Fix permissions + continue-on-error: true + run: |- + find "${{ github.workspace }}/bins" -type d -exec chmod +rwx {} \; + find "${{ github.workspace }}/bins" -type f -exec chmod +rw {} \; + shell: bash + + - name: Capture Extracted Build ZIP + continue-on-error: true + run: Get-ChildItem "${{ github.workspace }}/bins/*" -Recurse -ErrorAction SilentlyContinue + shell: pwsh + + - name: Test + if: success() + run: |- + Import-Module ./tools/ci.psm1 + Restore-PSOptions -PSOptionsPath '${{ github.workspace }}/build/psoptions.json' + $options = (Get-PSOptions) + $rootPath = '${{ github.workspace }}/bins' + $originalRootPath = Split-Path -path $options.Output + $path = Join-Path -path $rootPath -ChildPath (split-path -leaf -path $originalRootPath) + $pwshPath = Join-Path -path $path -ChildPath 'pwsh' + chmod a+x $pwshPath + $options.Output = $pwshPath + Set-PSOptions $options + Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' -TitlePrefix '${{ inputs.buildName }}' + 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 }}' + } + 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' + 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: true + previous-results-report: false + ai-report: true + 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 + if: always() + uses: actions/upload-artifact@v4 + with: + name: junit-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: ${{ inputs.ctrfFolder }} + + + diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml new file mode 100644 index 00000000000..1d5a592b6b6 --- /dev/null +++ b/.github/workflows/linux-ci.yml @@ -0,0 +1,140 @@ +name: powershell/PowerShell-CI-linux +on: + workflow_dispatch: + + push: + branches: + - master + - release* + - feature* + paths: + - "*" + - "!.vsts-ci/misc-analysis.yml" + - "!.github/ISSUE_TEMPLATE/*" + - "!.github/workflows/*" + - "!.dependabot/config.yml" + - "!.pipelines/*" + - "!test/perf/*" + pull_request: + branches: + - master + - release* + - feature* + paths: + - "*" + - "!.dependabot/config.yml" + - "!.github/ISSUE_TEMPLATE/*" + - "!.github/workflows/*" + - "!.vsts-ci/misc-analysis.yml" + - "!.vsts-ci/windows.yml" + - "!.vsts-ci/windows/*" + - "!tools/cgmanifest.json" + - "!LICENSE.txt" + - "!test/common/markdown/*" + - "!test/perf/*" + - "!tools/releaseBuild/*" + - "!tools/install*" + - "!tools/releaseBuild/azureDevOps/templates/*" + - "!README.md" + - "!.spelling" + - "!.pipelines/*" +env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + FORCE_FEATURE: 'False' + FORCE_PACKAGE: 'False' + NUGET_KEY: none + POWERSHELL_TELEMETRY_OPTOUT: 1 + __SuppressAnsiEscapeSequences: 1 + nugetMultiFeedWarnLevel: none + system_debug: 'false' +jobs: + ci_build: + name: Build PowerShell + runs-on: ubuntu-20.04 + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 + - name: Build + uses: "./.github/actions/build/ci" + linux_test_unelevated_ci: + name: Linux Unelevated CI + needs: ci_build + runs-on: ubuntu-20.04 + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 + - name: Windows Unelevated CI + uses: "./.github/actions/test/nix" + with: + purpose: UnelevatedPesterTests + tagSet: CI + linux_test_elevated_ci: + name: Linux Elevated CI + needs: ci_build + runs-on: ubuntu-20.04 + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 + - name: Windows Elevated CI + uses: "./.github/actions/test/nix" + with: + purpose: ElevatedPesterTests + tagSet: CI + linux_test_unelevated_others: + name: Linux Unelevated Others + needs: ci_build + runs-on: ubuntu-20.04 + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 + - name: Windows Unelevated Others + uses: "./.github/actions/test/nix" + with: + purpose: UnelevatedPesterTests + tagSet: Others + linux_test_elevated_others: + name: Linux Elevated Others + needs: ci_build + runs-on: ubuntu-20.04 + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 + - name: Windows Elevated Others + uses: "./.github/actions/test/nix" + with: + purpose: ElevatedPesterTests + tagSet: Others + verify_xunit: + name: Verify xUnit test results + needs: ci_build + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 + - name: Verify xUnit test results + uses: "./.github/actions/test/verify_xunit" + + linux_packaging: + name: Attempt Linux Packaging + needs: ci_build + runs-on: ubuntu-20.04 + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + fetch-depth: 1000 + - name: Verify xUnit test results + uses: "./.github/actions/test/linux-packaging" diff --git a/.github/workflows/powershell-ci-linux.yml b/.github/workflows/powershell-ci-linux.yml deleted file mode 100644 index 5bdaf9aa07c..00000000000 --- a/.github/workflows/powershell-ci-linux.yml +++ /dev/null @@ -1,180 +0,0 @@ -name: powershell/PowerShell-CI-linux -on: - workflow_dispatch: - inputs: - ContainerPattern: - description: | - Pattern to match JobName of the container. - Update this to force a container. - `.` will match everything - default: "." - type: string - required: false - push: - branches: - - master - - release* - - feature* - paths: - - "*" - - "!.vsts-ci/misc-analysis.yml" - - "!.github/ISSUE_TEMPLATE/*" - - "!.github/workflows/*" - - "!.dependabot/config.yml" - - "!.pipelines/*" - - "!test/perf/*" - pull_request: - branches: - - master - - release* - - feature* - paths: - - "*" - - "!.dependabot/config.yml" - - "!.github/ISSUE_TEMPLATE/*" - - "!.github/workflows/*" - - "!.vsts-ci/misc-analysis.yml" - - "!.vsts-ci/windows.yml" - - "!.vsts-ci/windows/*" - - "!tools/cgmanifest.json" - - "!LICENSE.txt" - - "!test/common/markdown/*" - - "!test/perf/*" - - "!tools/releaseBuild/*" - - "!tools/install*" - - "!tools/releaseBuild/azureDevOps/templates/*" - - "!README.md" - - "!.spelling" - - "!.pipelines/*" -env: - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - FORCE_FEATURE: 'False' - FORCE_PACKAGE: 'False' - NUGET_KEY: none - POWERSHELL_TELEMETRY_OPTOUT: 1 - __SuppressAnsiEscapeSequences: 1 - nugetMultiFeedWarnLevel: none - system_debug: 'false' -jobs: - vsts_ci_templates_ci_build: - name: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_ci_build.yml" - with: - pool: ubuntu-20.04 - jobName: linux_build - displayName: linux Build - vsts_ci_templates_nix_test: - name: vsts_ci_templates_nix_test - needs: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_nix_test.yml" - with: - pool: ubuntu-20.04 - purpose: UnelevatedPesterTests - tagSet: CI - name: Ubuntu - vsts_ci_templates_nix_test_2: - name: vsts_ci_templates_nix_test_2 - needs: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_nix_test.yml" - with: - pool: ubuntu-20.04 - purpose: ElevatedPesterTests - tagSet: CI - name: Ubuntu - vsts_ci_templates_nix_test_3: - name: vsts_ci_templates_nix_test_3 - needs: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_nix_test.yml" - with: - pool: ubuntu-20.04 - purpose: UnelevatedPesterTests - tagSet: Others - name: Ubuntu - vsts_ci_templates_nix_test_4: - name: vsts_ci_templates_nix_test_4 - needs: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_nix_test.yml" - with: - pool: ubuntu-20.04 - purpose: ElevatedPesterTests - tagSet: Others - name: Ubuntu - 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" - with: - pool: ubuntu-20.04 - TestContainer-getContainerJob: - name: Choose a container - needs: - - vsts_ci_templates_ci_build - runs-on: ubuntu-20.04 - steps: - - name: checkout - uses: actions/checkout@v4.1.0 - - uses: actions/checkout@v4.1.0 - - uses: actions/checkout@v4.1.0 - with: - repository: PowerShell/PowerShell-Docker - ref: master - token: "${{ secrets.CHECKOUT_TOKEN }}" - - name: Initialize Container Stage - id: getContainerTask - continue-on-error: true - run: |- - # Initialize container test stage - Import-Module ./PowerShell/tools/ci.psm1 - Invoke-InitializeContainerStage -ContainerPattern '${{ parameters.ContainerPattern }}' - shell: pwsh - vsts_ci_templates_test_nix_container_test: - name: vsts_ci_templates_test_nix_container_test - needs: - - TestContainer-getContainerJob - - vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_test_nix_container_test.yml" - with: - pool: ubuntu-20.04 - purpose: UnelevatedPesterTests - tagSet: CI - name: container - vsts_ci_templates_test_nix_container_test_2: - name: vsts_ci_templates_test_nix_container_test_2 - needs: - - TestContainer-getContainerJob - - vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_test_nix_container_test.yml" - with: - pool: ubuntu-20.04 - purpose: ElevatedPesterTests - tagSet: CI - name: container - vsts_ci_templates_test_nix_container_test_3: - name: vsts_ci_templates_test_nix_container_test_3 - needs: - - TestContainer-getContainerJob - - vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_test_nix_container_test.yml" - with: - pool: ubuntu-20.04 - purpose: UnelevatedPesterTests - tagSet: Others - name: container - vsts_ci_templates_test_nix_container_test_4: - name: vsts_ci_templates_test_nix_container_test_4 - needs: - - TestContainer-getContainerJob - - vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_templates_test_nix_container_test.yml" - with: - pool: ubuntu-20.04 - purpose: ElevatedPesterTests - tagSet: Others - name: container - vsts_ci_linux_templates_packaging: - name: vsts_ci_linux_templates_packaging - needs: vsts_ci_templates_ci_build - uses: "./.github/workflows/vsts_ci_linux_templates_packaging.yml" - with: - pool: ubuntu-20.04 diff --git a/.github/workflows/vsts_ci_templates_ci_build.yml b/.github/workflows/vsts_ci_templates_ci_build.yml deleted file mode 100644 index a21a3ffa569..00000000000 --- a/.github/workflows/vsts_ci_templates_ci_build.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/vsts_ci_templates_nix_test.yml b/.github/workflows/vsts_ci_templates_nix_test.yml deleted file mode 100644 index 000862fb6a1..00000000000 --- a/.github/workflows/vsts_ci_templates_nix_test.yml +++ /dev/null @@ -1,32 +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_nix_test -on: - workflow_call: - inputs: - pool: - required: false - default: macOS-latest - type: string - purpose: - required: false - default: '' - type: string - tagSet: - required: false - default: CI - type: string - name: - required: false - default: mac - type: string -jobs: - ${{ parameters.name }}_test_${{ parameters.purpose }}_${{ parameters.tagSet }}: - name: ${{ parameters.name }} Test - ${{ parameters.purpose }} - ${{ parameters.tagSet }} - runs-on: ${{ inputs.pool }} - steps: - - name: checkout - uses: actions/checkout@v4.1.0 - - uses: "./.github/actions/vsts_ci_templates_test_nix_test_steps" - with: - purpose: "${{ inputs.purpose }}" - tagSet: "${{ inputs.tagSet }}" diff --git a/.github/workflows/vsts_ci_templates_test_nix_container_test.yml b/.github/workflows/vsts_ci_templates_test_nix_container_test.yml deleted file mode 100644 index ae3c656f8f1..00000000000 --- a/.github/workflows/vsts_ci_templates_test_nix_container_test.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_test_nix_container_test -on: - workflow_call: - inputs: - pool: - required: false - default: macOS-latest - type: string - purpose: - required: false - default: '' - type: string - tagSet: - required: false - default: CI - type: string - name: - required: false - default: mac - type: string -jobs: - ${{ parameters.name }}_test_${{ parameters.purpose }}_${{ parameters.tagSet }}: - name: ${{ parameters.name }} Test - ${{ parameters.purpose }} - ${{ parameters.tagSet }} - runs-on: ${{ inputs.pool }} - container: - image: "$[ variables.getContainerJob ]" - env: - __INCONTAINER: 1 - containerBuildName: UPDATE ME - getContainerJob: UPDATE ME - steps: - - name: checkout - uses: actions/checkout@v4.1.0 - - uses: "./.github/actions/vsts_ci_templates_test_nix_test_steps" - with: - purpose: "${{ inputs.purpose }}" - tagSet: "${{ inputs.tagSet }}" - buildName: "${{ env.containerBuildName }}" diff --git a/.github/workflows/vsts_ci_templates_verify_xunit.yml b/.github/workflows/vsts_ci_templates_verify_xunit.yml deleted file mode 100644 index 415d64e10af..00000000000 --- a/.github/workflows/vsts_ci_templates_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 From fc30f67e9e886ade8d106936d73404f731a6c702 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 13:16:55 -0800 Subject: [PATCH 11/28] fix trigger filters --- .github/workflows/linux-ci.yml | 52 ++++++++++++++------------------ .github/workflows/windows-ci.yml | 5 ++- 2 files changed, 24 insertions(+), 33 deletions(-) diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index 1d5a592b6b6..8b365b1c48b 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -4,40 +4,32 @@ on: push: branches: - - master - - release* - - feature* + - master + - release* + - feature* paths: - - "*" - - "!.vsts-ci/misc-analysis.yml" - - "!.github/ISSUE_TEMPLATE/*" - - "!.github/workflows/*" - - "!.dependabot/config.yml" - - "!.pipelines/*" - - "!test/perf/*" + - "*" + - "!.github/ISSUE_TEMPLATE/*" + - "!.dependabot/config.yml" + - "!.pipelines/*" + - "!test/perf/*" pull_request: branches: - - master - - release* - - feature* + - master + - release* + - feature* paths: - - "*" - - "!.dependabot/config.yml" - - "!.github/ISSUE_TEMPLATE/*" - - "!.github/workflows/*" - - "!.vsts-ci/misc-analysis.yml" - - "!.vsts-ci/windows.yml" - - "!.vsts-ci/windows/*" - - "!tools/cgmanifest.json" - - "!LICENSE.txt" - - "!test/common/markdown/*" - - "!test/perf/*" - - "!tools/releaseBuild/*" - - "!tools/install*" - - "!tools/releaseBuild/azureDevOps/templates/*" - - "!README.md" - - "!.spelling" - - "!.pipelines/*" + - ".github/actions/*" + - ".github/workflows/windows-ci.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 diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index e82d881686e..9c25adefe9f 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -10,7 +10,6 @@ on: - "*" - "!.vsts-ci/misc-analysis.yml" - "!.github/ISSUE_TEMPLATE/*" - - "!.github/workflows/*" - "!.dependabot/config.yml" - "!test/perf/*" - "!.pipelines/*" @@ -20,8 +19,8 @@ on: - release* - feature* paths: - - ".vsts-ci/templates/*" - - ".vsts-ci/windows.yml" + - ".github/actions/*" + - ".github/workflows/windows-ci.yml" - "*.props" - build.psm1 - src/* From d44735b1d2861db2e5f1c4e61a55f8a2308cca32 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 13:18:28 -0800 Subject: [PATCH 12/28] add run-name --- .github/workflows/linux-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index 8b365b1c48b..e50e09de405 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -1,4 +1,7 @@ -name: powershell/PowerShell-CI-linux +name: Linux-CI + +run-name: "${{ github.ref_name }} - ${{ github.run_number }}" + on: workflow_dispatch: From be31bb2342418dbc7d47f1028939ab1781e95c88 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 13:25:57 -0800 Subject: [PATCH 13/28] disable linux packaging tests --- .github/workflows/linux-ci.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index e50e09de405..df365ca6f6b 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -122,14 +122,20 @@ jobs: - name: Verify xUnit test results uses: "./.github/actions/test/verify_xunit" - linux_packaging: - name: Attempt Linux Packaging - needs: ci_build - runs-on: ubuntu-20.04 - steps: - - name: checkout - uses: actions/checkout@v4.1.0 - with: - fetch-depth: 1000 - - name: Verify xUnit test results - uses: "./.github/actions/test/linux-packaging" + # TODO: Enable this when we have a Linux packaging workflow + + # ERROR: While executing gem ... (Gem::FilePermissionError) + # You don't have write permissions for the /var/lib/gems/2.7.0 directory. + # WARNING: Installation of gem dotenv 2.8.1 failed! Must resolve manually. + + # linux_packaging: + # name: Attempt Linux Packaging + # needs: ci_build + # runs-on: ubuntu-20.04 + # steps: + # - name: checkout + # uses: actions/checkout@v4.1.0 + # with: + # fetch-depth: 1000 + # - name: Verify xUnit test results + # uses: "./.github/actions/test/linux-packaging" From abf93184dd15ab7641aaeb36bb8bbe1e7a56bf68 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 13:26:55 -0800 Subject: [PATCH 14/28] delete unused actions --- .../action.yml | 59 -------------- .../action.yml | 11 --- .../action.yml | 80 ------------------- 3 files changed, 150 deletions(-) delete mode 100644 .github/actions/pipelines_templates_insert_nuget_config_azfeed/action.yml delete mode 100644 .github/actions/tools_releasebuild_azuredevops_templates_insert_nuget_config_azfeed/action.yml delete mode 100644 .github/actions/vsts_ci_templates_test_nix_test_steps/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 ddac1647309..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 \ No newline at end of file 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 b46c179745f..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 }}" \ No newline at end of file diff --git a/.github/actions/vsts_ci_templates_test_nix_test_steps/action.yml b/.github/actions/vsts_ci_templates_test_nix_test_steps/action.yml deleted file mode 100644 index d1fd6454649..00000000000 --- a/.github/actions/vsts_ci_templates_test_nix_test_steps/action.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: vsts_ci_templates_test_nix_test_steps -inputs: - purpose: - required: false - default: '' - type: string - tagSet: - required: false - default: CI - type: string - buildName: - required: false - default: Ubuntu - type: string -runs: - using: composite - steps: - - 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: |- - Import-Module .\tools\ci.psm1 - Invoke-CIInstall -SkipUser - shell: pwsh - - name: Extract Files - uses: actions/github-script@v7.0.0 - env: - DESTINATION_FOLDER: "${{ github.workspace }}/bins" - ARCHIVE_FILE_PATTERNS: "${{ github.workspace }}/build/build.zip" - with: - script: |- - const fs = require('fs').promises - const path = require('path') - const target = path.resolve(process.env.DESTINATION_FOLDER) - const patterns = process.env.ARCHIVE_FILE_PATTERNS - const globber = await glob.create(patterns) - await io.mkdirP(path.dirname(target)) - for await (const file of globber.globGenerator()) { - if ((await fs.lstat(file)).isDirectory()) continue - await exec.exec(`7z x ${file} -o${target} -aoa`) - } - - name: Fix permissions - continue-on-error: true - run: |- - find "${{ github.workspace }}/bins" -type d -exec chmod +rwx {} \; - find "${{ github.workspace }}/bins" -type f -exec chmod +rw {} \; - shell: bash - - name: Capture Extracted Build ZIP - continue-on-error: true - run: Get-ChildItem "${{ github.workspace }}\bins\*" -Recurse -ErrorAction SilentlyContinue - shell: pwsh - - name: Test - if: success() - run: |- - Import-Module .\tools\ci.psm1 - Restore-PSOptions -PSOptionsPath '${{ github.workspace }}\build\psoptions.json' - $options = (Get-PSOptions) - $rootPath = '${{ github.workspace }}\bins' - $originalRootPath = Split-Path -path $options.Output - $path = Join-Path -path $rootPath -ChildPath (split-path -leaf -path $originalRootPath) - $pwshPath = Join-Path -path $path -ChildPath 'pwsh' - chmod a+x $pwshPath - $options.Output = $pwshPath - Set-PSOptions $options - Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' -TitlePrefix '${{ inputs.buildName }}' - shell: pwsh \ No newline at end of file From 05efb9703b2f08f4e578b6c552097b1f5b45ce92 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 13:27:22 -0800 Subject: [PATCH 15/28] use pwsh as a shell where powershell 5.1 is not needed --- .github/actions/test/nix/action.yml | 4 ++-- .github/actions/test/windows/action.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/test/nix/action.yml b/.github/actions/test/nix/action.yml index c573f803800..b7b7da13637 100644 --- a/.github/actions/test/nix/action.yml +++ b/.github/actions/test/nix/action.yml @@ -32,7 +32,7 @@ runs: shell: pwsh - name: Bootstrap - shell: powershell + shell: pwsh run: |- Import-Module ./tools/ci.psm1 Invoke-CIInstall -SkipUser @@ -88,7 +88,7 @@ runs: 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 }}' } - shell: powershell + shell: pwsh # this task only takes / as directory separators - name: Publish Test Report diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 6cb5cbc1d74..6a749b49cda 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -65,7 +65,7 @@ runs: 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 }}' } - shell: powershell + shell: pwsh # this task only takes / as directory separators - name: Publish Test Report From 19d492ba7d5dafb0c7b02f00a3fb7f6ddb369700 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 13:44:41 -0800 Subject: [PATCH 16/28] switch pester to JUnit --- .github/actions/test/nix/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test/nix/action.yml b/.github/actions/test/nix/action.yml index b7b7da13637..a98dabfd7f6 100644 --- a/.github/actions/test/nix/action.yml +++ b/.github/actions/test/nix/action.yml @@ -80,7 +80,7 @@ runs: chmod a+x $pwshPath $options.Output = $pwshPath Set-PSOptions $options - Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' -TitlePrefix '${{ inputs.buildName }}' + Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' -TitlePrefix '${{ inputs.buildName }}' -OutputFormat JUnitXml shell: pwsh - name: Convert JUnit to CTRF From 045495b4d8fcc0b98be668b4c0e71370618bb0df Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 13:53:08 -0800 Subject: [PATCH 17/28] Update linux ci.psm1 to take pester output format --- tools/ci.psm1 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 7dda90f14f3..a117ecdc312 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -259,7 +259,7 @@ function Invoke-CITest if($IsLinux -or $IsMacOS) { - return Invoke-LinuxTestsCore -Purpose $Purpose -ExcludeTag $ExcludeTag -TagSet $TagSet -TitlePrefix $TitlePrefix + return Invoke-LinuxTestsCore -Purpose $Purpose -ExcludeTag $ExcludeTag -TagSet $TagSet -TitlePrefix $TitlePrefix -OutputFormat $OutputFormat } # CoreCLR @@ -702,7 +702,8 @@ function Invoke-LinuxTestsCore [string] $Purpose = 'All', [string[]] $ExcludeTag = @('Slow', 'Feature', 'Scenario'), [string] $TagSet = 'CI', - [string] $TitlePrefix + [string] $TitlePrefix, + [string] $OutputFormat = "NUnitXml" ) $output = Split-Path -Parent (Get-PSOutput -Options (Get-PSOptions)) @@ -715,12 +716,13 @@ function Invoke-LinuxTestsCore $sudoResultsWithExpFeatures = $null $noSudoPesterParam = @{ - 'BinDir' = $output - 'PassThru' = $true - 'Terse' = $true - 'Tag' = @() - 'ExcludeTag' = $testExcludeTag - 'OutputFile' = $testResultsNoSudo + 'BinDir' = $output + 'PassThru' = $true + 'Terse' = $true + 'Tag' = @() + 'ExcludeTag' = $testExcludeTag + 'OutputFile' = $testResultsNoSudo + 'OutputFormat' = $OutputFormat } # Get the experimental feature names and the tests associated with them @@ -773,6 +775,7 @@ function Invoke-LinuxTestsCore $sudoPesterParam['ExcludeTag'] = $ExcludeTag $sudoPesterParam['Sudo'] = $true $sudoPesterParam['OutputFile'] = $testResultsSudo + $sudoPesterParam['OutputFormat'] = $OutputFormat $title = "Pester Sudo - $TagSet" if ($TitlePrefix) { From ea09cc3102eab76cd98410f06168c240e3a18817 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 13:55:43 -0800 Subject: [PATCH 18/28] delete unused workflow --- .../vsts_ci_linux_templates_packaging.yml | 105 ------------------ 1 file changed, 105 deletions(-) delete mode 100644 .github/workflows/vsts_ci_linux_templates_packaging.yml diff --git a/.github/workflows/vsts_ci_linux_templates_packaging.yml b/.github/workflows/vsts_ci_linux_templates_packaging.yml deleted file mode 100644 index 52c1e1c20b0..00000000000 --- a/.github/workflows/vsts_ci_linux_templates_packaging.yml +++ /dev/null @@ -1,105 +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_linux_templates_packaging -on: - workflow_call: - inputs: - pool: - required: false - default: ubuntu-20.04 - type: string - name: - required: false - default: Linux - type: string -jobs: - ${{ parameters.name }}_packaging: - name: ${{ parameters.name }} packaging - runs-on: ${{ inputs.pool }} - steps: - - name: checkout - uses: actions/checkout@v4.1.0 - - 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: |- - Import-Module .\build.psm1 - Start-PSBootstrap -Package - shell: pwsh - - name: Capture Artifacts Directory - continue-on-error: true - run: Import-Module ./build.psm1 - shell: pwsh - - name: Extract Files - uses: actions/github-script@v7.0.0 - env: - DESTINATION_FOLDER: "${{ github.workspace }}/bins" - ARCHIVE_FILE_PATTERNS: "${{ github.workspace }}/build/build.zip" - with: - script: |- - const fs = require('fs').promises - const path = require('path') - const target = path.resolve(process.env.DESTINATION_FOLDER) - const patterns = process.env.ARCHIVE_FILE_PATTERNS - const globber = await glob.create(patterns) - await io.mkdirP(path.dirname(target)) - for await (const file of globber.globGenerator()) { - if ((await fs.lstat(file)).isDirectory()) continue - await exec.exec(`7z x ${file} -o${target} -aoa`) - } - - name: Fix permissions - continue-on-error: true - run: |- - find "${{ github.workspace }}/bins" -type d -exec chmod +rwx {} \; - find "${{ github.workspace }}/bins" -type f -exec chmod +rw {} \; - shell: bash - - name: Capture Extracted Build ZIP - continue-on-error: true - run: Get-ChildItem "${{ github.workspace }}\bins\*" -Recurse -ErrorAction SilentlyContinue - shell: pwsh - - name: Packaging Tests - if: success() - run: |- - Import-Module .\tools\ci.psm1 - Restore-PSOptions -PSOptionsPath '${{ github.workspace }}\build\psoptions.json' - $options = (Get-PSOptions) - $rootPath = '${{ github.workspace }}\bins' - $originalRootPath = Split-Path -path $options.Output - $path = Join-Path -path $rootPath -ChildPath (split-path -leaf -path $originalRootPath) - $pwshPath = Join-Path -path $path -ChildPath 'pwsh' - chmod a+x $pwshPath - $options.Output = $pwshPath - Set-PSOptions $options - Invoke-CIFinish - shell: pwsh - - name: Upload packages - run: |- - Get-ChildItem "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.deb" -Recurse | ForEach-Object { - $packagePath = $_.FullName - Write-Host "Uploading $packagePath" - Write-Host "##vso[artifact.upload containerfolder=deb;artifactname=deb]$packagePath" - } - Get-ChildItem "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.rpm" -Recurse | ForEach-Object { - $packagePath = $_.FullName - Write-Host "Uploading $packagePath" - Write-Host "##vso[artifact.upload containerfolder=rpm;artifactname=rpm]$packagePath" - } - Get-ChildItem "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}\*.tar.gz" -Recurse | ForEach-Object { - $packagePath = $_.FullName - Write-Host "Uploading $packagePath" - Write-Host "##vso[artifact.upload containerfolder=rpm;artifactname=rpm]$packagePath" - } - shell: pwsh From ca74356d5851475e6395d10c5178c5e44193c7d8 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 14:10:59 -0800 Subject: [PATCH 19/28] move common reporting code to a composite action --- .github/actions/test/nix/action.yml | 52 ++------------- .../test/process-pester-results/action.yml | 65 +++++++++++++++++++ .github/actions/test/windows/action.yml | 49 ++------------ 3 files changed, 75 insertions(+), 91 deletions(-) create mode 100644 .github/actions/test/process-pester-results/action.yml diff --git a/.github/actions/test/nix/action.yml b/.github/actions/test/nix/action.yml index a98dabfd7f6..68daa95e1da 100644 --- a/.github/actions/test/nix/action.yml +++ b/.github/actions/test/nix/action.yml @@ -83,51 +83,9 @@ runs: Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' -TitlePrefix '${{ inputs.buildName }}' -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 }}' - } - shell: pwsh - - # this task only takes / as directory separators - - name: Publish Test Report - uses: ctrf-io/github-test-reporter@v1 - 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: true - previous-results-report: false - ai-report: true - 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 - if: always() - uses: actions/upload-artifact@v4 + - name: Convert, Publish, and Upload Pester Test Results + uses: "./.github/actions/test/process-pester-test-results" with: - name: junit-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: ${{ inputs.ctrfFolder }} - - - + name: "${{ inputs.purpose }}-${{ inputs.tagSet }}" + testResultsFolder: "${{ runner.workspace }}/testResults" + ctrfFolder: "${{ inputs.ctrfFolder }}" diff --git a/.github/actions/test/process-pester-results/action.yml b/.github/actions/test/process-pester-results/action.yml new file mode 100644 index 00000000000..746af137b17 --- /dev/null +++ b/.github/actions/test/process-pester-results/action.yml @@ -0,0 +1,65 @@ +name: process-pester-test-results +description: 'Process Pester test results' + +inputs: + name: + required: true + default: '' + type: string + testResultsFolder: + required: false + default: "${{ runner.workspace }}/testResults" + type: string + ctrfFolder: + required: false + default: ctrf + type: string + +runs: + using: composite + steps: + - name: Convert JUnit to CTRF + run: |- + Get-ChildItem -Path "${{ inputs.testResultsFolder }}/testResults/*.xml" -Recurse | ForEach-Object { + npx --yes junit-to-ctrf $_.FullName --output ./${{ inputs.ctrfFolder }}/$($_.BaseName).json --tool Pester + } + shell: pwsh + + # this task only takes / as directory separators + - name: Publish Test Report + uses: ctrf-io/github-test-reporter@v1 + 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: true + previous-results-report: false + ai-report: true + 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 + if: always() + uses: actions/upload-artifact@v4 + with: + name: junit-pester-${{ inputs.name }} + path: ${{ runner.workspace }}/testResults + + - name: Upload ctrf artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: ctrf-pester-${{ inputs.name }} + path: ${{ inputs.ctrfFolder }} diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index 6a749b49cda..a15ffc5889a 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -60,48 +60,9 @@ runs: 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 }}' - } - shell: pwsh - - # this task only takes / as directory separators - - name: Publish Test Report - uses: ctrf-io/github-test-reporter@v1 - 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: true - previous-results-report: false - ai-report: true - 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 - if: always() - uses: actions/upload-artifact@v4 - with: - name: junit-pester-${{ inputs.purpose }}-${{ inputs.tagSet }} - path: ${{ runner.workspace }}\testResults - - - name: Upload ctrf artifact - if: always() - uses: actions/upload-artifact@v4 + - name: Convert, Publish, and Upload Pester Test Results + uses: "./.github/actions/test/process-pester-test-results" with: - name: ctrf-pester-${{ inputs.purpose }}-${{ inputs.tagSet }} - path: ${{ inputs.ctrfFolder }} + name: "${{ inputs.purpose }}-${{ inputs.tagSet }}" + testResultsFolder: ${{ runner.workspace }}\testResults + ctrfFolder: "${{ inputs.ctrfFolder }}" From 3ab5ed8a9fde46aeca457474f7b12e2bc3c3aa5d Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 14:21:37 -0800 Subject: [PATCH 20/28] skip test tool build on additional test runs on same agent --- tools/ci.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index a117ecdc312..da8467727ec 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -384,7 +384,7 @@ function Invoke-CITest } Write-Verbose -Verbose "Starting Pester with output format $($arguments.OutputFormat)" - Start-PSPester @arguments -Title $title + Start-PSPester @arguments -Title $title -SkipTestToolBuild # Fail the build, if tests failed Test-PSPesterResults -TestResultsFile $expFeatureTestResultFile @@ -760,7 +760,7 @@ function Invoke-LinuxTestsCore if ($TitlePrefix) { $title = "$TitlePrefix - $title" } - $passThruResult = Start-PSPester @noSudoPesterParam -Title $title + $passThruResult = Start-PSPester @noSudoPesterParam -Title $title -SkipTestToolBuild $noSudoResultsWithExpFeatures += $passThruResult } @@ -808,7 +808,7 @@ function Invoke-LinuxTestsCore if ($TitlePrefix) { $title = "$TitlePrefix - $title" } - $passThruResult = Start-PSPester @sudoPesterParam -Title $title + $passThruResult = Start-PSPester @sudoPesterParam -Title $title -SkipTestToolBuild $sudoResultsWithExpFeatures += $passThruResult } From a64182a42380eda710f469719af69beecdeaaba7 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 14:21:52 -0800 Subject: [PATCH 21/28] fix action path --- .github/actions/test/nix/action.yml | 2 +- .github/actions/test/windows/action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/test/nix/action.yml b/.github/actions/test/nix/action.yml index 68daa95e1da..97575b6b54d 100644 --- a/.github/actions/test/nix/action.yml +++ b/.github/actions/test/nix/action.yml @@ -84,7 +84,7 @@ runs: shell: pwsh - name: Convert, Publish, and Upload Pester Test Results - uses: "./.github/actions/test/process-pester-test-results" + uses: "./.github/actions/test/process-pester-results" with: name: "${{ inputs.purpose }}-${{ inputs.tagSet }}" testResultsFolder: "${{ runner.workspace }}/testResults" diff --git a/.github/actions/test/windows/action.yml b/.github/actions/test/windows/action.yml index a15ffc5889a..c8e1c86024a 100644 --- a/.github/actions/test/windows/action.yml +++ b/.github/actions/test/windows/action.yml @@ -61,7 +61,7 @@ runs: shell: pwsh - name: Convert, Publish, and Upload Pester Test Results - uses: "./.github/actions/test/process-pester-test-results" + uses: "./.github/actions/test/process-pester-results" with: name: "${{ inputs.purpose }}-${{ inputs.tagSet }}" testResultsFolder: ${{ runner.workspace }}\testResults From 026941101f8c0f41a86f0098a6b14cf68a987f69 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 14:32:23 -0800 Subject: [PATCH 22/28] fix filters to recurse --- .github/workflows/linux-ci.yml | 22 +++++++++++----------- .github/workflows/windows-ci.yml | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index df365ca6f6b..50a153be214 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -11,28 +11,28 @@ on: - release* - feature* paths: - - "*" - - "!.github/ISSUE_TEMPLATE/*" + - "**" + - "!.github/ISSUE_TEMPLATE/**" - "!.dependabot/config.yml" - - "!.pipelines/*" - - "!test/perf/*" + - "!.pipelines/**" + - "!test/perf/**" pull_request: branches: - master - release* - feature* paths: - - ".github/actions/*" + - ".github/actions/**" - ".github/workflows/windows-ci.yml" - - "*.props" + - "**.props" - build.psm1 - - src/* - - test/* - - tools/buildCommon/* + - src/** + - test/** + - tools/buildCommon/** - tools/ci.psm1 - tools/WindowsCI.psm1 - - "!test/common/markdown/*" - - "!test/perf/*" + - "!test/common/markdown/**" + - "!test/perf/**" env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 9c25adefe9f..718cd6ccf2b 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -7,29 +7,29 @@ on: - release* - feature* paths: - - "*" + - "**" - "!.vsts-ci/misc-analysis.yml" - - "!.github/ISSUE_TEMPLATE/*" + - "!.github/ISSUE_TEMPLATE/**" - "!.dependabot/config.yml" - - "!test/perf/*" - - "!.pipelines/*" + - "!test/perf/**" + - "!.pipelines/**" pull_request: branches: - master - release* - feature* paths: - - ".github/actions/*" + - ".github/actions/**" - ".github/workflows/windows-ci.yml" - - "*.props" + - "**.props" - build.psm1 - - src/* - - test/* - - tools/buildCommon/* + - src/** + - test/** + - tools/buildCommon/** - tools/ci.psm1 - tools/WindowsCI.psm1 - - "!test/common/markdown/*" - - "!test/perf/*" + - "!test/common/markdown/**" + - "!test/perf/**" permissions: contents: read From 5b8a8c616d73e1c5860e0e5122b2f22daea7d15a Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 14:36:19 -0800 Subject: [PATCH 23/28] fix path creation --- .github/actions/test/process-pester-results/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test/process-pester-results/action.yml b/.github/actions/test/process-pester-results/action.yml index 746af137b17..6311998badd 100644 --- a/.github/actions/test/process-pester-results/action.yml +++ b/.github/actions/test/process-pester-results/action.yml @@ -20,7 +20,7 @@ runs: steps: - name: Convert JUnit to CTRF run: |- - Get-ChildItem -Path "${{ inputs.testResultsFolder }}/testResults/*.xml" -Recurse | ForEach-Object { + Get-ChildItem -Path "${{ inputs.testResultsFolder }}/*.xml" -Recurse | ForEach-Object { npx --yes junit-to-ctrf $_.FullName --output ./${{ inputs.ctrfFolder }}/$($_.BaseName).json --tool Pester } shell: pwsh From b439c6ca0049724f7b186ae17a6ef3a0819889b7 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 14:56:49 -0800 Subject: [PATCH 24/28] Add comments about gem installation issue --- .github/actions/test/linux-packaging/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actions/test/linux-packaging/action.yml b/.github/actions/test/linux-packaging/action.yml index a42b6327dea..1f2a0c75af1 100644 --- a/.github/actions/test/linux-packaging/action.yml +++ b/.github/actions/test/linux-packaging/action.yml @@ -2,6 +2,13 @@ name: linux_packaging description: 'Test very basic Linux packaging' +# This isn't working yet +# It fails with + +# ERROR: While executing gem ... (Gem::FilePermissionError) +# You don't have write permissions for the /var/lib/gems/2.7.0 directory. +# WARNING: Installation of gem dotenv 2.8.1 failed! Must resolve manually. + runs: using: composite steps: From ed85b9c019b5338a6062db8238aeb2d5b8b3d1f7 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 14:57:28 -0800 Subject: [PATCH 25/28] Remove extra newlines in action.yml --- .github/actions/test/linux-packaging/action.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/actions/test/linux-packaging/action.yml b/.github/actions/test/linux-packaging/action.yml index 1f2a0c75af1..61d23742056 100644 --- a/.github/actions/test/linux-packaging/action.yml +++ b/.github/actions/test/linux-packaging/action.yml @@ -1,7 +1,6 @@ name: linux_packaging description: 'Test very basic Linux packaging' - # This isn't working yet # It fails with @@ -94,6 +93,3 @@ runs: Write-Host "##vso[artifact.upload containerfolder=rpm;artifactname=rpm]$packagePath" } shell: pwsh - - - From 01ae09ed320bb70a4f395ce5ef5769f12f1b15df Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 15:01:46 -0800 Subject: [PATCH 26/28] address PR comments --- .github/actions/test/process-pester-results/action.yml | 1 - tools/ci.psm1 | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/test/process-pester-results/action.yml b/.github/actions/test/process-pester-results/action.yml index 6311998badd..758bbdfc353 100644 --- a/.github/actions/test/process-pester-results/action.yml +++ b/.github/actions/test/process-pester-results/action.yml @@ -47,7 +47,6 @@ runs: pull-request-report: false commit-report: false custom-report: false - if: always() - name: Upload testResults artifact diff --git a/tools/ci.psm1 b/tools/ci.psm1 index da8467727ec..f09d159b4c8 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -384,6 +384,7 @@ function Invoke-CITest } Write-Verbose -Verbose "Starting Pester with output format $($arguments.OutputFormat)" + # 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 @@ -808,6 +809,8 @@ function Invoke-LinuxTestsCore if ($TitlePrefix) { $title = "$TitlePrefix - $title" } + + # We just built the test tools for the main test run, we don't need to rebuild them $passThruResult = Start-PSPester @sudoPesterParam -Title $title -SkipTestToolBuild $sudoResultsWithExpFeatures += $passThruResult From f30f1a2a6334c6765bd91e7d7fba3ca22db745c2 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 15:47:09 -0800 Subject: [PATCH 27/28] fix step name --- .github/workflows/linux-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index 50a153be214..89164a5289b 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -63,7 +63,7 @@ jobs: uses: actions/checkout@v4.1.0 with: fetch-depth: 1000 - - name: Windows Unelevated CI + - name: Linux Unelevated CI uses: "./.github/actions/test/nix" with: purpose: UnelevatedPesterTests @@ -77,7 +77,7 @@ jobs: uses: actions/checkout@v4.1.0 with: fetch-depth: 1000 - - name: Windows Elevated CI + - name: Linux Elevated CI uses: "./.github/actions/test/nix" with: purpose: ElevatedPesterTests @@ -91,7 +91,7 @@ jobs: uses: actions/checkout@v4.1.0 with: fetch-depth: 1000 - - name: Windows Unelevated Others + - name: Linux Unelevated Others uses: "./.github/actions/test/nix" with: purpose: UnelevatedPesterTests @@ -105,7 +105,7 @@ jobs: uses: actions/checkout@v4.1.0 with: fetch-depth: 1000 - - name: Windows Elevated Others + - name: Linux Elevated Others uses: "./.github/actions/test/nix" with: purpose: ElevatedPesterTests From eba407ce4ac002bbe7c7b0a5d2d1816cb617a809 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Jan 2025 15:48:48 -0800 Subject: [PATCH 28/28] fix triggers --- .github/workflows/linux-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index 89164a5289b..0709bee66c2 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -23,7 +23,7 @@ on: - feature* paths: - ".github/actions/**" - - ".github/workflows/windows-ci.yml" + - ".github/workflows/linux-ci.yml" - "**.props" - build.psm1 - src/**