Skip to content

Bump Dependencies

Bump Dependencies #303

Workflow file for this run

---
name: "AzOps - Tests"
on:
workflow_dispatch:
pull_request_target:
branches: [main]
paths:
- "src/**"
- "!src/AzOps.psd1"
permissions:
id-token: write
contents: write
pull-requests: write
jobs:
tests:
name: "Tests"
runs-on: ubuntu-latest
environment: test
env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
steps:
# Checkout
- name: "Checkout"
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.sha}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
# Dependencies
- name: "Dependencies"
shell: pwsh
run: |
./scripts/Dependencies.ps1
# Connect to Azure - TEMPORARY until 2.7.0 credential expiration issue is fixed
- name: "Connect"
shell: pwsh
run: |
$credential = New-Object PSCredential -ArgumentList $env:ARM_CLIENT_ID, (ConvertTo-SecureString -String $env:ARM_CLIENT_SECRET -AsPlainText -Force)
Connect-AzAccount -TenantId $env:ARM_TENANT_ID -ServicePrincipal -Credential $credential -SubscriptionId $env:ARM_SUBSCRIPTION_ID
# # Authenticate Azure context
# - name: OIDC Login to Azure Public Cloud with AzPowershell (enableAzPSSession true)
# uses: azure/login@v1
# with:
# client-id: ${{ env.ARM_CLIENT_ID }}
# tenant-id: ${{ env.ARM_TENANT_ID }}
# subscription-id: ${{ env.ARM_SUBSCRIPTION_ID }}
# enable-AzPSSession: true
# Run General Tests
- name: "Run General Tests"
shell: pwsh
run: |
./src/tests/Pester.ps1 -TestGeneral $true
# Run Functions Tests
- name: "Run Functions Tests"
shell: pwsh
run: |
./src/tests/Pester.ps1 -TestFunctions $true
# Run Environment Primer
- name: "Run Environment Primer"
shell: pwsh
run: |
./src/tests/Pester.ps1 -CleanupEnvironment $true
# Run Functional Tests
- name: "Run Functional Tests"
shell: pwsh
run: |
./src/tests/Pester.ps1 -TestFunctional $true
# Run Integration Tests
- name: "Run Integration Tests"
if: always()
shell: pwsh
run: |
./src/tests/Pester.ps1 -TestIntegration $true
# Run Cleanup Environment
- name: "Run Environment Cleanup"
shell: pwsh
run: |
./src/tests/Pester.ps1 -CleanupEnvironment $true
testsubonly:
needs: tests
name: "Tests - Subscription Only"
runs-on: ubuntu-latest
environment: test
env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID_SUB }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET_SUB }}
steps:
# Checkout
- name: "Checkout"
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.sha}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
# Dependencies
- name: "Dependencies"
shell: pwsh
run: |
./scripts/Dependencies.ps1
# Connect to Azure - TEMPORARY until 2.7.0 credential expiration issue is fixed
- name: "Connect"
shell: pwsh
run: |
$credential = New-Object PSCredential -ArgumentList $env:ARM_CLIENT_ID, (ConvertTo-SecureString -String $env:ARM_CLIENT_SECRET -AsPlainText -Force)
Connect-AzAccount -TenantId $env:ARM_TENANT_ID -ServicePrincipal -Credential $credential -SubscriptionId $env:ARM_SUBSCRIPTION_ID
# # Authenticate Azure context
# - name: OIDC Login to Azure Public Cloud with AzPowershell (enableAzPSSession true)
# uses: azure/login@v1
# with:
# client-id: ${{ env.ARM_CLIENT_ID_SUB }}
# tenant-id: ${{ env.ARM_TENANT_ID }}
# subscription-id: ${{ env.ARM_SUBSCRIPTION_ID }}
# enable-AzPSSession: true
# Run Subscription Only Tests
- name: "Run Subscription Only Tests"
shell: pwsh
run: |
./src/tests/Pester.ps1 -TestSubscriptionOnly $true
# Run Cleanup Environment
- name: "Run Environment Cleanup"
shell: pwsh
run: |
./src/tests/Pester.ps1 -CleanupEnvironment $true