Merge pull request #423 from 40net-cloud/fgt-vm-update-version #115
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: '[FGT] ARM - Active-Passive-ELB-ILB' | |
env: | |
ARMPath: FortiGate/Active-Passive-ELB-ILB/ | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- 'FortiGate/Active-Passive-ELB-ILB/*.json' | |
- 'FortiGate/Active-Passive-ELB-ILB/**.tests.ps1' | |
jobs: | |
ARM_Active-Passive-ELB-ILB: | |
name: 'ARM Template Active-Passive-ELB-ILB' | |
runs-on: ubuntu-latest | |
env: | |
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} | |
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} | |
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} | |
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: ARM TTK - Test ARM Templates | |
shell: pwsh | |
run: | | |
Install-Module -Name Pester -RequiredVersion 4.10.1 -Force | |
Import-Module -Name Pester -RequiredVersion 4.10.1 -Force | |
Invoke-WebRequest -Uri "https://aka.ms/arm-ttk-latest" -OutFile arm-template-toolkit.zip | |
Expand-Archive -LiteralPath arm-template-toolkit.zip -DestinationPath arm-ttk | |
Import-Module ./arm-ttk/arm-ttk/arm-ttk.psd1 | |
echo "Test-AzTemplate -TemplatePath ${{ env.ARMPath }} -Pester" | Out-File -FilePath ./armttk.ps1 | |
Invoke-Pester -Script ./armttk.ps1 -EnableExit -OutputFormat NUnitXml -OutputFile ./test-armttk.xml | |
- name: Azure Login via Az module | |
uses: azure/login@v2 | |
with: | |
creds: ${{secrets.AZURE_CREDENTIALS}} | |
enable-AzPSSession: true | |
- name: ARM Template - Custom Pester tests | |
uses: azure/powershell@v2 | |
with: | |
inlineScript: | | |
mkdir -p /home/runner/.ssh/ | |
chmod 700 /home/runner/.ssh/ | |
ssh-keygen -t ed25519 -f /home/runner/.ssh/id_ed25519 -C "[email protected]" -N '' | |
chmod 400 /home/runner/.ssh/id_ed25519* | |
Set-PSRepository psgallery -InstallationPolicy trusted | |
Install-Module -Name Pester -RequiredVersion 5.0.4 -confirm:$false -Force | |
$container = New-PesterContainer -Path "${{ env.ARMPath }}" -Data @{sshkey = "/home/runner/.ssh/id_ed25519"; sshkeypub = "/home/runner/.ssh/id_ed25519.pub"} | |
$config = New-PesterConfiguration | |
$config.Run.Container = $container | |
$config.Run.Exit = $true | |
$config.Run.PassThru = $true | |
$config.TestResult.OutputFormat = "NUnitXML" | |
$config.TestResult.OutputPath = "test-custom.xml" | |
$config.Output.Verbosity = 'Detailed' | |
Invoke-Pester -Configuration $config | |
azPSVersion: "latest" | |
- name: Publish Test Results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: FGT-Active-Passive-ELB-ILB-Test-Results | |
path: ./test-*.xml | |
if: ${{ always() }} | |
- name: Microsoft Teams Notification | |
uses: jvhoof/notify-microsoft-teams@main | |
if: always() | |
with: | |
webhook_url: ${{ secrets.MS_TEAMS_WEBHOOK_URI }} | |
needs: ${{ toJson(needs) }} | |
job: ${{ toJson(job) }} | |
steps: ${{ toJson(steps) }} |