Merge pull request #429 from 40net-cloud/fwb-vm-update-version #91
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: '[FWB] ARM - A-Single-VM' | |
env: | |
ARMPath: FortiWeb/A-Single-VM/ | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- 'FortiWeb/A-Single-VM/**.json' | |
- 'FortiWeb/A-Single-VM/**.tests.ps1' | |
jobs: | |
ARM_A-Single-VM: | |
name: '[FWB] ARM Template A-Single-VM' | |
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: Test ARM Templates - path | |
id: armttktest | |
uses: aliencube/[email protected] | |
with: | |
path: ${{ env.ARMPath }} | |
- name: Test result - path | |
shell: bash | |
continue-on-error: true | |
run: | | |
echo "${{ toJSON(fromJSON(steps.armttktest.outputs.results)) }}" | |
- name: Azure Login via Az module | |
uses: azure/login@v2 | |
with: | |
creds: ${{secrets.AZURE_CREDENTIALS}} | |
enable-AzPSSession: true | |
- name: Run Pester tests (pwsh) | |
uses: azure/powershell@v2 | |
with: | |
inlineScript: | | |
mkdir -p /home/runner/.ssh/ | |
ssh-keygen -t rsa -b 4096 -f /home/runner/.ssh/id_rsa -C "[email protected]" -N '' | |
Write-host $PSVersionTable.PSVersion.Major $PSVersionTable.PSRemotingProtocolVersion.Minor | |
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_rsa"; sshkeypub = "/home/runner/.ssh/id_rsa.pub"} | |
$config = New-PesterConfiguration | |
$config.Run.Container = $container | |
$config.Run.Exit = $true | |
$config.Run.PassThru = $true | |
$config.TestResult.OutputFormat = "NUnitXML" | |
$config.TestResult.OutputPath = "Test-Pester.XML" | |
$config.Output.Verbosity = 'Detailed' | |
Invoke-Pester -Configuration $config | |
azPSVersion: "latest" | |
- name: Post result to Teams | |
uses: freenet-actions/ms-teams-deploy-card@master # or "./" if in a local set-up | |
if: always() | |
with: | |
github-token: ${{ github.token }} | |
webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }} |