disable output in CI logs (#359)

This commit is contained in:
Yan Xu
2023-10-26 15:26:50 +08:00
committed by GitHub
parent 4e0edd18ae
commit 0431fbf166
5 changed files with 116 additions and 91 deletions

View File

@@ -38,7 +38,7 @@ jobs:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- run: |
az account show
az account show --output none
- name: 'Az CLI login without subscription'
uses: azure/login@v1
@@ -47,7 +47,7 @@ jobs:
allow-no-subscriptions: true
- run: |
az account show
az account show --output none
- name: 'Az CLI login with subscription OIDC'
uses: azure/login@v1
@@ -57,7 +57,7 @@ jobs:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTIONID }}
- run: |
az account show
az account show --output none
- name: 'Az CLI login without subscription OIDC'
uses: azure/login@v1
@@ -67,9 +67,7 @@ jobs:
allow-no-subscriptions: true
- run: |
az account show
az account show --output none
slack-post-result:
runs-on: ubuntu-latest

View File

@@ -19,8 +19,8 @@ jobs:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- run: |
az account show
# az webapp list
az account show --output none
az vm list --output none
- name: 'Az CLI login without subscription'
uses: azure/login@v1
@@ -29,7 +29,7 @@ jobs:
allow-no-subscriptions: true
- run: |
az account show
az account show --output none
- name: 'Azure PowerShell login with subscription'
uses: azure/login@v1
@@ -39,7 +39,7 @@ jobs:
- uses: azure/powershell@v1
with:
inlineScript: "Get-AzContext"
inlineScript: "(Get-AzContext).Environment.Name"
azPSVersion: "latest"
- name: 'Azure PowerShell login without subscription'
@@ -51,7 +51,7 @@ jobs:
- uses: azure/powershell@v1
with:
inlineScript: "Get-AzContext"
inlineScript: "(Get-AzContext).Environment.Name"
azPSVersion: "latest"
az-login-test-oidc:
@@ -66,8 +66,8 @@ jobs:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTIONID }}
- run: |
az account show
# az webapp list
az account show --output none
az vm list --output none
- name: 'Az CLI login without subscription'
uses: azure/login@v1
@@ -77,7 +77,7 @@ jobs:
allow-no-subscriptions: true
- run: |
az account show
az account show --output none
- name: 'Azure PowerShell login with subscription'
uses: azure/login@v1
@@ -89,7 +89,7 @@ jobs:
- uses: azure/powershell@v1
with:
inlineScript: "Get-AzContext"
inlineScript: "(Get-AzContext).Environment.Name"
azPSVersion: "latest"
- name: 'Azure PowerShell login without subscription'
@@ -102,7 +102,7 @@ jobs:
- uses: azure/powershell@v1
with:
inlineScript: "Get-AzContext"
inlineScript: "(Get-AzContext).Environment.Name"
azPSVersion: "latest"
slack-post-result:

View File

@@ -37,9 +37,9 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az group show --name GitHubAction_CI_RG
az vm list
az account show --output none
az group show --name GitHubAction_CI_RG --output none
az vm list --output none
- name: Run Azure PowerShell
id: ps_1
@@ -48,9 +48,9 @@ jobs:
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
Get-AzResourceGroup -Name GitHubAction_CI_RG
Get-AzVM
(Get-AzContext).Environment.Name -eq 'AzureCloud'
(Get-AzResourceGroup -Name GitHubAction_CI_RG).ResourceGroupName -eq 'GitHubAction_CI_RG'
(Get-AzVM).Count -gt 0
- name: Check Last step failed
if: steps.ps_1.outcome == 'success'
@@ -71,7 +71,7 @@ jobs:
- name: Run Azure Cli again
run: |
az account show
az account show --output none
- name: Run Azure PowerShell again
id: ps_2
@@ -80,7 +80,7 @@ jobs:
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
(Get-AzContext).Environment.Name -eq 'AzureCloud'
- name: Check Last step failed
if: steps.ps_2.outcome == 'success'
@@ -124,9 +124,9 @@ jobs:
id: cli_3
continue-on-error: true
run: |
az account show
az group show --name GitHubAction_CI_RG
az vm list
az account show --output none
az group show --name GitHubAction_CI_RG --output none
az vm list --output none
- name: Check Last step failed
if: steps.cli_3.outcome == 'success'
@@ -142,9 +142,9 @@ jobs:
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
Get-AzResourceGroup -Name GitHubAction_CI_RG
Get-AzVM
(Get-AzContext).Environment.Name -eq 'AzureCloud'
(Get-AzResourceGroup -Name GitHubAction_CI_RG).ResourceGroupName -eq 'GitHubAction_CI_RG'
(Get-AzVM).Count -gt 0
- name: Check Last step failed
if: steps.ps_3.outcome == 'success'
@@ -259,9 +259,9 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az group show --name GitHubAction_CI_RG
az vm list
az account show --output none
az group show --name GitHubAction_CI_RG --output none
az vm list --output none
- name: Run Azure PowerShell
id: ps_8
@@ -270,9 +270,9 @@ jobs:
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
Get-AzResourceGroup -Name GitHubAction_CI_RG
Get-AzVM
(Get-AzContext).Environment.Name -eq 'AzureCloud'
(Get-AzResourceGroup -Name GitHubAction_CI_RG).ResourceGroupName -eq 'GitHubAction_CI_RG'
(Get-AzVM).Count -gt 0
- name: Check Last step failed
if: steps.ps_8.outcome == 'success'
@@ -289,9 +289,9 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az group show --name GitHubAction_CI_RG
az vm list
az account show --output none
az group show --name GitHubAction_CI_RG --output none
az vm list --output none
- name: Run Azure PowerShell
id: ps_9
@@ -300,9 +300,9 @@ jobs:
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
Get-AzResourceGroup -Name GitHubAction_CI_RG
Get-AzVM
(Get-AzContext).Environment.Name -eq 'AzureCloud'
(Get-AzResourceGroup -Name GitHubAction_CI_RG).ResourceGroupName -eq 'GitHubAction_CI_RG'
(Get-AzVM).Count -gt 0
- name: Check Last step failed
if: steps.ps_9.outcome == 'success'

View File

@@ -42,18 +42,21 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az group show --name GitHubAction_CI_RG
az vm list
az account show --output none
az group show --name GitHubAction_CI_RG --output none
az vm list --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1.2.0
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
Get-AzResourceGroup -Name GitHubAction_CI_RG
Get-AzVM
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
$checkResult = $checkResult -and ((Get-AzResourceGroup -Name GitHubAction_CI_RG).ResourceGroupName -eq 'GitHubAction_CI_RG')
$checkResult = $checkResult -and ((Get-AzVM).Count -gt 0)
if(-not $checkResult){
throw "Not all checks passed!"
}
- name: Login with individual parameters
uses: ./
@@ -66,14 +69,17 @@ jobs:
- name: Run Azure Cli again
run: |
az account show
az account show --output none
- name: Run Azure PowerShell again
uses: azure/powershell@v1.2.0
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
if(-not $checkResult){
throw "Not all checks passed!"
}
- name: Login with explicit auth-type
uses: ./
@@ -84,18 +90,21 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az group show --name GitHubAction_CI_RG
az vm list
az account show --output none
az group show --name GitHubAction_CI_RG --output none
az vm list --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1.2.0
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
Get-AzResourceGroup -Name GitHubAction_CI_RG
Get-AzVM
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
$checkResult = $checkResult -and ((Get-AzResourceGroup -Name GitHubAction_CI_RG).ResourceGroupName -eq 'GitHubAction_CI_RG')
$checkResult = $checkResult -and ((Get-AzVM).Count -gt 0)
if(-not $checkResult){
throw "Not all checks passed!"
}
ParameterTest:
strategy:
@@ -126,9 +135,9 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az group show --name GitHubAction_CI_RG
az vm list
az account show --output none
az group show --name GitHubAction_CI_RG --output none
az vm list --output none
- name: Login with creds, wrong boolean value
uses: ./
@@ -138,9 +147,9 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az group show --name GitHubAction_CI_RG
az vm list
az account show --output none
az group show --name GitHubAction_CI_RG --output none
az vm list --output none
- name: Login with creds, allow no subscription
uses: ./
@@ -151,18 +160,21 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az group show --name GitHubAction_CI_RG
az vm list
az account show --output none
az group show --name GitHubAction_CI_RG --output none
az vm list --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1.2.0
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
Get-AzResourceGroup -Name GitHubAction_CI_RG
Get-AzVM
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
$checkResult = $checkResult -and ((Get-AzResourceGroup -Name GitHubAction_CI_RG).ResourceGroupName -eq 'GitHubAction_CI_RG')
$checkResult = $checkResult -and ((Get-AzVM).Count -gt 0)
if(-not $checkResult){
throw "Not all checks passed!"
}
- name: Login with individual parameters, no subscription, allow no subscription
uses: ./
@@ -174,14 +186,17 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az account show --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1.2.0
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
if(-not $checkResult){
throw "Not all checks passed!"
}
VMTest:
strategy:
@@ -213,14 +228,17 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az account show --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1.2.0
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
if(-not $checkResult){
throw "Not all checks passed!"
}
- name: Login with system-assigned managed identity, with subscription id
uses: ./
@@ -231,18 +249,21 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az group show --name GitHubAction_CI_RG
az vm list
az account show --output none
az group show --name GitHubAction_CI_RG --output none
az vm list --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1.2.0
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
Get-AzResourceGroup -Name GitHubAction_CI_RG
Get-AzVM
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
$checkResult = $checkResult -and ((Get-AzResourceGroup -Name GitHubAction_CI_RG).ResourceGroupName -eq 'GitHubAction_CI_RG')
$checkResult = $checkResult -and ((Get-AzVM).Count -gt 0)
if(-not $checkResult){
throw "Not all checks passed!"
}
- name: Login with tenant-level user-assigned managed identity with allow-no-subscriptions
uses: ./
@@ -254,14 +275,17 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az account show --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1.2.0
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
if(-not $checkResult){
throw "Not all checks passed!"
}
- name: Login with user-assigned managed identity, subscription-id
uses: ./
@@ -273,17 +297,19 @@ jobs:
- name: Run Azure Cli
run: |
az account show
az group show --name GitHubAction_CI_RG
az vm list
az account show --output none
az group show --name GitHubAction_CI_RG --output none
az vm list --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1.2.0
with:
azPSVersion: "latest"
inlineScript: |
Get-AzContext | Format-List
Get-AzResourceGroup -Name GitHubAction_CI_RG
Get-AzVM
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
$checkResult = $checkResult -and ((Get-AzResourceGroup -Name GitHubAction_CI_RG).ResourceGroupName -eq 'GitHubAction_CI_RG')
$checkResult = $checkResult -and ((Get-AzVM).Count -gt 0)
if(-not $checkResult){
throw "Not all checks passed!"
}

View File

@@ -34,8 +34,8 @@ jobs:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- run: |
az account show
# az webapp list
az account show --output none
az vm list --output none
- name: 'Az CLI login without subscription'
uses: ./
@@ -44,7 +44,8 @@ jobs:
allow-no-subscriptions: true
- run: |
az account show
az account show --output none
az vm list --output none
- name: 'Azure PowerShell login with subscription'
uses: ./
@@ -54,7 +55,7 @@ jobs:
- uses: azure/powershell@v1
with:
inlineScript: "Get-AzContext"
inlineScript: "(Get-AzContext).Environment.Name"
azPSVersion: "latest"
# - name: 'Azure PowerShell login without subscription'