Skip to content

Support vnets with multiple address ranges 2 #98

Support vnets with multiple address ranges 2

Support vnets with multiple address ranges 2 #98

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
name: Test Linux
strategy:
fail-fast: true
# PowerShell Docker images - https://mcr.microsoft.com/v2/powershell/tags/list
# Versions in support - https://learn.microsoft.com/en-us/powershell/scripting/install/powershell-support-lifecycle?view=powershell-7.3&WT.mc_id=DOP-MVP-5001655
matrix:
include:
# - version: 6.2.4-ubuntu-18.04
# networkVersion: "2.5.0" # https://www.powershellgallery.com/packages/Az.Network/2.5.0/Content/Az.Network.psm1
# - version: 7.0.3-ubuntu-18.04 # 7.0 LTS Out of support
# networkVersion: "5.2.0"
- version: lts-ubuntu-22.04 # 7.2 LTS Current
networkVersion: "5.2.0"
- version: ubuntu-22.04 # 7.4 Stable
networkVersion: "5.2.0"
- version: preview-ubuntu-22.04 # 7.5 Preview
networkVersion: "5.2.0"
- version: ubuntu-22.04 # 7.4
networkVersion: "7.0.0"
- version: ubuntu-22.04 # 7.4
networkVersion: "7.8.0"
runs-on: ubuntu-22.04
container: mcr.microsoft.com/powershell:${{ matrix.version }}
steps:
- uses: actions/checkout@v3
- name: Install Pester Module
run: |
$ErrorActionPreference = 'Stop'
$PSVersionTable
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module Pester -Scope CurrentUser -Repository PSGallery -Force
Install-Module -Name Az.Network -requiredVersion ${{ matrix.networkVersion }} -Scope CurrentUser -Repository PSGallery -Force -Verbose
Get-InstalledModule
shell: pwsh -Command "$ProgressPreference = 'SilentlyContinue'; & '{0}'"
- name: Run Pester Tests
run: |
Import-Module Pester
$cfg = [PesterConfiguration]::Default
$cfg.Output.Verbosity = 'Detailed'
$cfg.CodeCoverage.Enabled = $true
$cfg.Run.Exit = $true
Invoke-Pester -Configuration $cfg
shell: pwsh -Command "$ProgressPreference = 'SilentlyContinue'; & '{0}'"
test-windows:
name: Test Windows
strategy:
fail-fast: true
matrix:
os: [ windows-2019, windows-2022 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Remove old Pester
run: |
# https://pester.dev/docs/introduction/installation#removing-the-built-in-version-of-pester
$module = "C:\Program Files\WindowsPowerShell\Modules\Pester"
takeown /F $module /A /R
icacls $module /reset
icacls $module /grant "*S-1-5-32-544:F" /inheritance:d /T
Remove-Item -Path $module -Recurse -Force -Confirm:$false
shell: powershell
- name: PowerShell Module Cache
uses: potatoqualitee/psmodulecache@v6.2
with:
modules-to-cache: Pester, Az.Network, Az.Accounts
shell: powershell
- name: Run Pester Tests
run: |
Get-InstalledModule
Import-Module Pester
$cfg = [PesterConfiguration]::Default
$cfg.Output.Verbosity = 'Detailed'
$cfg.CodeCoverage.Enabled = $true
$cfg.Run.Exit = $true
Invoke-Pester -Configuration $cfg
shell: powershell
create-release:
name: Create Release
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- test
- test-windows
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Nerdbank.GitVersioning
uses: dotnet/nbgv@v0.4.2
id: nbgv
- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
makeLatest: true
commit: main
tag: v${{ steps.nbgv.outputs.SimpleVersion }}
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}