Skip to content

Add 10 more retry on outbound command to ensure vmagent fetched the latest mapping #13732

Add 10 more retry on outbound command to ensure vmagent fetched the latest mapping

Add 10 more retry on outbound command to ensure vmagent fetched the latest mapping #13732

name: Windows Powershell Unit Test
on: pull_request
jobs:
pester-test:
name: Pester test
runs-on: windows-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Perform a Pester test from the parts/windows/*.tests.ps1 file
shell: powershell
run: |
Invoke-Pester parts/windows/*.tests.ps1 -Passthru
- name: Perform a Pester test from the vhdbuilder/packer/windows/*.tests.ps1 file
shell: pwsh
run: |
Invoke-Pester vhdbuilder/packer/windows/*.tests.ps1 -Passthru
- name: Perform a Pester test from the staging/cse/windows/*.tests.ps1 file
shell: powershell
run: |
Install-Module -Name powershell-yaml -Force
Invoke-Pester staging/cse/windows/*.tests.ps1 -Passthru
compare-components-output:
name: Compare components.json for each windows VHD
runs-on: windows-latest
permissions:
pull-requests: write
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: master
path: master
fetch-depth: 1
- name: Check out repository code
uses: actions/checkout@v4
with:
path: pr
fetch-depth: 1
- name: Produce vhd files - master
shell: pwsh
run: |
cd pr
mkdir vhd_files
pwsh -c vhdbuilder/scripts/windows/generate_cached_stuff_list.ps1 vhd_files vhdbuilder/packer/windows/components_json_helpers.ps1 ../master/vhdbuilder/packer/windows/windows_settings.json ../master/parts/common/components.json
git add vhd_files
git config user.email "[email protected]"
git config user.name "Your Name"
git commit -m "versions of files from master"
pwsh -c vhdbuilder/scripts/windows/generate_cached_stuff_list.ps1 vhd_files vhdbuilder/packer/windows/components_json_helpers.ps1 vhdbuilder/packer/windows/windows_settings.json parts/common/components.json
mkdir -p ../.github/workflows
$diffFile = "../.github/workflows/diff.md"
git diff --quiet
if ( $LASTEXITCODE -eq "0" ) {
Write-Output "No changes to cached containers or packages on Windows VHDs" > $diffFile
} else {
Write-Output "Changes cached containers or packages on windows VHDs" > $diffFile
Write-Output "" >> $diffFile
Write-Output '```diff' >> $diffFile
git diff >> $diffFile
Write-Output '```' >> $diffFile
}
dir $diffFile
Get-Content $diffFile
- name: Add comment to PR
uses: NejcZdovc/comment-pr@v2
with:
file: "diff.md"
identifier: "WINDOWS_VHD_CONTENT_DIFF"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}