-
Notifications
You must be signed in to change notification settings - Fork 995
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Jack Tracey <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jack Tracey <[email protected]> Co-authored-by: JamJarchitect <[email protected]> Co-authored-by: Panagiotis Korologos <[email protected]>
- Loading branch information
1 parent
8d75c8f
commit 2224bc4
Showing
74 changed files
with
4,649 additions
and
152 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,5 @@ | |
|
||
# GitHub Super Linter | ||
super-linter.log | ||
|
||
src/data/eslzArm.test.deployment.json |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# ALZ Policy Testing Workflow Sample | ||
|
||
``` YAML | ||
name: ALZ Tests for Policy | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
branches: | ||
- main | ||
- TestingFramework # For testing purposes only update as needed based on branch name | ||
paths: | ||
- ".github/workflows/**" | ||
- "tests/policy/**" | ||
- "tests/utils/**" | ||
workflow_dispatch: | ||
inputs: | ||
remarks: | ||
description: "Reason for triggering the workflow run" | ||
required: false | ||
default: "Testing Azure Policies..." | ||
|
||
jobs: | ||
test-alz-policies: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
persist-credentials: false | ||
|
||
- name: Install PowerShell modules | ||
shell: pwsh | ||
run: | | ||
Install-Module -Name "Az" -RequiredVersion "10.1.0" -Force -Scope CurrentUser -ErrorAction Stop | ||
Update-AzConfig -DisplayBreakingChangeWarning $false | ||
- name: Azure login (OIDC) | ||
uses: azure/login@v1 | ||
if: ${{ success() && env.AZURE_CLIENT_SECRET == '' }} | ||
with: | ||
client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
enable-AzPSSession: true | ||
env: | ||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
|
||
- name: Azure login (Client Secret) | ||
uses: azure/login@v1 | ||
if: ${{ success() && env.AZURE_CLIENT_SECRET != '' }} | ||
with: | ||
creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}' | ||
enable-AzPSSession: true | ||
env: | ||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
|
||
- name: Pester Test for Policies | ||
shell: pwsh | ||
run: | | ||
Import-Module Pester -Force | ||
$pesterConfiguration = @{ | ||
Run = @{ | ||
Path = "tests/*.tests.ps1" | ||
PassThru = $true | ||
} | ||
Output = @{ | ||
Verbosity = 'Detailed' | ||
CIFormat = 'Auto' | ||
} | ||
} | ||
$result = Invoke-Pester -Configuration $pesterConfiguration | ||
exit $result.FailedCount | ||
env: | ||
SUBSCRIPTION_ID: ${{ secrets.AZURE_POLICY_SUBSCRIPTION1_ID }} | ||
SUBSCRIPTION2_ID: ${{ secrets.AZURE_POLICY_SUBSCRIPTION2_ID }} #Used for policy tests that require a second subscription (e.g. cross subscription peering) | ||
TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | ||
``` |
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
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.