diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 2164e11514..36dc1c662a 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -139,7 +139,7 @@ jobs: Write-Verbose "No Multi-Repo Checkout" -Verbose $modulePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' } - Write-Host "##vso[task.setvariable variable=ENVMODULEPATH]$modulePath" + Write-Output "##vso[task.setvariable variable=ENVMODULEPATH]$modulePath" # [Universal Artifact-feed publish] task(s) #------------------------------------------ diff --git a/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml b/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml index 66901fb038..c0e95e552e 100644 --- a/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml +++ b/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml @@ -147,8 +147,8 @@ jobs: $moduleRepoRoot = '$(System.DefaultWorkingDirectory)' $parametersRepoRoot = '$(System.DefaultWorkingDirectory)' } - Write-Host "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" - Write-Host "##vso[task.setvariable variable=parametersRepoRoot]$parametersRepoRoot" + Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" + Write-Output "##vso[task.setvariable variable=parametersRepoRoot]$parametersRepoRoot" # [Agent] Replace tokens #----------------------- diff --git a/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml b/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml index 288ff4416d..beb9661412 100644 --- a/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml +++ b/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml @@ -101,8 +101,8 @@ jobs: $moduleRepoRoot = '$(System.DefaultWorkingDirectory)' $parametersRepoRoot = '$(System.DefaultWorkingDirectory)' } - Write-Host "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" - Write-Host "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot" + Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" + Write-Output "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot" # [Agent] Prepare environment #---------------------------- @@ -213,8 +213,8 @@ jobs: $moduleRepoRoot = '$(System.DefaultWorkingDirectory)' $parametersRepoRoot = '$(System.DefaultWorkingDirectory)' } - Write-Host "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" - Write-Host "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot" + Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" + Write-Output "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot" # [Agent] Prepare environment #---------------------------- diff --git a/.github/actions/templates/getWorkflowInput/action.yml b/.github/actions/templates/getWorkflowInput/action.yml index 398f57d545..5638c99df2 100644 --- a/.github/actions/templates/getWorkflowInput/action.yml +++ b/.github/actions/templates/getWorkflowInput/action.yml @@ -17,6 +17,9 @@ runs: - name: Get workflow input parameters id: get-input-param-action run: | + # Grouping task logs + Write-Output "::group::Get workflow input parameters" + Write-Verbose "The workflow trigger is: ${{ github.event_name }}" -Verbose # When running from workflow_dispatch event get input values @@ -42,4 +45,6 @@ runs: # Output values to be accessed by next jobs Write-Output "::set-output name=removeDeployment::$removeDeployment" + + Write-Output "::endgroup::" shell: pwsh diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index 3610e9c40c..8ee6cc8d23 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -38,6 +38,9 @@ runs: - name: 'Setup agent' shell: pwsh run: | + # Grouping task logs + Write-Output "::group::Setup agent" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -51,6 +54,8 @@ runs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules + Write-Output "::endgroup::" + - name: Azure Login uses: Azure/login@v1 with: @@ -61,6 +66,9 @@ runs: shell: pwsh if: ${{ inputs.templateSpecsDoPublish == 'true' }} run: | + # Grouping task logs + Write-Output "::group::Publish module to template specs" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesToUpdate.ps1') . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToTemplateSpec.ps1') @@ -91,10 +99,15 @@ runs: Publish-ModuleToTemplateSpec @functionInput -Verbose } + Write-Output "::endgroup::" + - name: 'Publish module to private bicep registry' shell: pwsh if: ${{ inputs.bicepRegistryDoPublish == 'true' }} run: | + # Grouping task logs + Write-Output "::group::Publish module to private bicep registry" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesToUpdate.ps1') . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1') @@ -124,3 +137,5 @@ runs: Publish-ModuleToPrivateBicepRegistry @functionInput -Verbose } + + Write-Output "::endgroup::" diff --git a/.github/actions/templates/validateModuleDeployment/action.yml b/.github/actions/templates/validateModuleDeployment/action.yml index 956635b4d9..3ed0dc0a7d 100644 --- a/.github/actions/templates/validateModuleDeployment/action.yml +++ b/.github/actions/templates/validateModuleDeployment/action.yml @@ -41,6 +41,9 @@ runs: - name: 'Setup agent' shell: pwsh run: | + # Grouping task logs + Write-Output "::group::Setup agent" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -64,6 +67,9 @@ runs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules + + Write-Output "::endgroup::" + - name: Azure Login uses: Azure/login@v1 with: @@ -75,6 +81,9 @@ runs: - name: 'Replace Parameter File Tokens [${{ inputs.parameterFilePath }}] ' shell: pwsh run: | + # Grouping task logs + Write-Output "::group::Replace Parameter File Tokens [${{ inputs.parameterFilePath }}]" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'tokensReplacement' 'Convert-TokensInParameterFile.ps1') @@ -105,11 +114,16 @@ runs: # Invoke Token Replacement Functionality $null = Convert-TokensInParameterFile @ConvertTokensInputs -Verbose + Write-Output "::endgroup::" + # [Deployment validation] task(s) # ------------------------------- - name: 'Validate [${{ inputs.templateFilePath }}]' shell: pwsh run: | + # Grouping task logs + Write-Output "::group::Validate [${{ inputs.templateFilePath }}]" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceValidation' 'Test-TemplateWithParameterFile.ps1') @@ -130,12 +144,17 @@ runs: Test-TemplateWithParameterFile @functionInput -Verbose + Write-Output "::endgroup::" + # [Deployment execution] task(s) # ------------------------------ - name: 'Deploy [${{ inputs.templateFilePath }}] with parameters [${{ inputs.parameterFilePath }}]' shell: pwsh id: deploy_step run: | + # Grouping task logs + Write-Output "::group::Deploy [${{ inputs.templateFilePath }}] with parameters [${{ inputs.parameterFilePath }}]" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceDeployment' 'New-ModuleDeployment.ps1') @@ -175,12 +194,17 @@ runs: throw $res.exception } + Write-Output "::endgroup::" + # [Deployment removal] task(s) # ---------------------------- - name: 'Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}]' shell: pwsh if: ${{ always() && inputs.removeDeployment == 'true' && steps.deploy_step.outputs.deploymentName != '' }} run: | + # Grouping task logs + Write-Output "::group::Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}]" + # Load used function . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceRemoval' 'Initialize-DeploymentRemoval.ps1') @@ -198,3 +222,5 @@ runs: Initialize-DeploymentRemoval @functionInput } + + Write-Output "::endgroup::" diff --git a/.github/actions/templates/validateModulePester/action.yml b/.github/actions/templates/validateModulePester/action.yml index 1bb6c5d7a8..bc5b9c46e0 100644 --- a/.github/actions/templates/validateModulePester/action.yml +++ b/.github/actions/templates/validateModulePester/action.yml @@ -13,6 +13,9 @@ runs: - name: 'Setup agent' shell: pwsh run: | + # Grouping task logs + Write-Output "::group::Setup agent" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -26,6 +29,8 @@ runs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules + Write-Output "::endgroup::" + - name: Azure Login uses: Azure/login@v1 with: @@ -38,6 +43,9 @@ runs: id: pester_run_step shell: pwsh run: | + # Grouping task logs + Write-Output "::group::Run global tests via Pester" + $moduleFolderPaths = @(Join-Path $env:GITHUB_WORKSPACE "${{ inputs.modulePath }}") $moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object { (Get-ChildItem $_ -File -Depth 0 -Include @('deploy.json', 'deploy.bicep') -Force).Count -gt 0 @@ -70,6 +78,8 @@ runs: } } + Write-Output "::endgroup::" + - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v1 if: always() && !contains('cancelled,skipped', steps.pester_run_step.outcome) @@ -83,6 +93,9 @@ runs: if: always() shell: pwsh run: | + # Grouping task logs + Write-Output "::group::Run API tests via Pester" + $moduleFolderPaths = @(Join-Path $env:GITHUB_WORKSPACE "${{ inputs.modulePath }}") $moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object { (Get-ChildItem $_ -File -Depth 0 -Include @('deploy.json', 'deploy.bicep') -Force).Count -gt 0 @@ -115,6 +128,8 @@ runs: } } + Write-Output "::endgroup::" + - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v1 if: always() && !contains('cancelled,skipped', steps.pester_api_run_step.outcome)