Skip to content

Functional Tests Entra ID #2

Functional Tests Entra ID

Functional Tests Entra ID #2

# Run functional tests for Entra ID
name: Functional Tests Entra ID
# This is a reusable workflow called by the pipeline.
on:
workflow_call:
inputs:
EmailOnFailure:
description: "True if an email should be sent when the workflow fails."
required: true
type: boolean
GitHubEventSchedule:
description: "A type of GitHub event"
required: true
type: string
GitHubEventName:
description: "The name of a GitHub event"
required: true
type: string
secrets:
PfxBase64:
required: true
PfxPassword:
required: true
TestParams:
required: true
TestParamsDev:
required: true
NotifierUsername:
required: true
NotifierPassword:
required: true
workflow_dispatch:
permissions:
id-token: write
contents: write
jobs:
Ent_Tenant1:
name: Ent_Tenant1
runs-on: windows-latest
environment: Development
permissions:
id-token: write
contents: write
concurrency:
group: Entra_Tenant1
cancel-in-progress: false
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
path: repo
- name: Import PFX
uses: ./repo/.github/actions/import-pfx
with:
PfxBase64: ${{ secrets.PfxBase64 }}
PfxPassword: ${{ secrets.PfxPassword }}
- name: Get Thumbprint
id: get-thumbprint
uses: ./repo/.github/actions/get-thumbprint
with:
PfxPassword: ${{ secrets.PfxPassword }}
- name: Restore ScubaGear
uses: actions/cache/restore@v4
with:
path: C:\Program Files\WindowsPowerShell\Modules\ScubaGear
key: scubagear-directory-
- name: Restore Dependencies
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: powershell-directory-
- name: Restore OPA
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\.scubagear\Tools
key: opa-directory-
- name: Test
uses: ./repo/.github/actions/test-product
with:
Thumbprint: ${{ steps.get-thumbprint.outputs.thumbprint }}
Alias: Ent_Tenant1
TestParams: ${{ secrets.TestParams }}
Ent_Tenant1_G5:
name: Ent_Tenant1_G5
runs-on: windows-latest
environment: Development
permissions:
id-token: write
contents: write
if: ${{ always() }}
needs:
- Ent_Tenant1
concurrency:
group: Entra_Tenant1
cancel-in-progress: false
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
path: repo
- name: Import PFX
uses: ./repo/.github/actions/import-pfx
with:
PfxBase64: ${{ secrets.PfxBase64 }}
PfxPassword: ${{ secrets.PfxPassword }}
- name: Get Thumbprint
id: get-thumbprint
uses: ./repo/.github/actions/get-thumbprint
with:
PfxPassword: ${{ secrets.PfxPassword }}
- name: Restore ScubaGear
uses: actions/cache/restore@v4
with:
path: C:\Program Files\WindowsPowerShell\Modules\ScubaGear
key: scubagear-directory-
- name: Restore Dependencies
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: powershell-directory-
- name: Restore OPA
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\.scubagear\Tools
key: opa-directory-
- name: Test
uses: ./repo/.github/actions/test-product
with:
Thumbprint: ${{ steps.get-thumbprint.outputs.thumbprint }}
Alias: Ent_Tenant1_G5
TestParams: ${{ secrets.TestParams }}
Ent_Tenant2:
name: Ent_Tenant2
runs-on: windows-latest
environment: Development
permissions:
id-token: write
contents: write
concurrency:
group: Entra_Tenant2
cancel-in-progress: false
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
path: repo
- name: Import PFX
uses: ./repo/.github/actions/import-pfx
with:
PfxBase64: ${{ secrets.PfxBase64 }}
PfxPassword: ${{ secrets.PfxPassword }}
- name: Get Thumbprint
id: get-thumbprint
uses: ./repo/.github/actions/get-thumbprint
with:
PfxPassword: ${{ secrets.PfxPassword }}
- name: Restore ScubaGear
uses: actions/cache/restore@v4
with:
path: C:\Program Files\WindowsPowerShell\Modules\ScubaGear
key: scubagear-directory-
- name: Restore Dependencies
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: powershell-directory-
- name: Restore OPA
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\.scubagear\Tools
key: opa-directory-
- name: Test
uses: ./repo/.github/actions/test-product
with:
Thumbprint: ${{ steps.get-thumbprint.outputs.thumbprint }}
Alias: Ent_Tenant2
TestParams: ${{ secrets.TestParams }}
Ent_Tenant2_G3:
name: Ent_Tenant2_G3
runs-on: windows-latest
environment: Development
permissions:
id-token: write
contents: write
if: ${{ always() }}
needs:
- Ent_Tenant2
concurrency:
group: Entra_Tenant2
cancel-in-progress: false
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
path: repo
- name: Import PFX
uses: ./repo/.github/actions/import-pfx
with:
PfxBase64: ${{ secrets.PfxBase64 }}
PfxPassword: ${{ secrets.PfxPassword }}
- name: Get Thumbprint
id: get-thumbprint
uses: ./repo/.github/actions/get-thumbprint
with:
PfxPassword: ${{ secrets.PfxPassword }}
- name: Restore ScubaGear
uses: actions/cache/restore@v4
with:
path: C:\Program Files\WindowsPowerShell\Modules\ScubaGear
key: scubagear-directory-
- name: Restore Dependencies
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: powershell-directory-
- name: Restore OPA
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\.scubagear\Tools
key: opa-directory-
- name: Test
uses: ./repo/.github/actions/test-product
with:
Thumbprint: ${{ steps.get-thumbprint.outputs.thumbprint }}
Alias: Ent_Tenant2_G3
TestParams: ${{ secrets.TestParams }}
Ent_Tenant3:
name: Ent_Tenant3
runs-on: windows-latest
environment: Development
permissions:
id-token: write
contents: write
concurrency:
group: Entra_Tenant3
cancel-in-progress: false
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
path: repo
- name: Import PFX
uses: ./repo/.github/actions/import-pfx
with:
PfxBase64: ${{ secrets.PfxBase64 }}
PfxPassword: ${{ secrets.PfxPassword }}
- name: Get Thumbprint
id: get-thumbprint
uses: ./repo/.github/actions/get-thumbprint
with:
PfxPassword: ${{ secrets.PfxPassword }}
- name: Restore ScubaGear
uses: actions/cache/restore@v4
with:
path: C:\Program Files\WindowsPowerShell\Modules\ScubaGear
key: scubagear-directory-
- name: Restore Dependencies
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: powershell-directory-
- name: Restore OPA
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\.scubagear\Tools
key: opa-directory-
- name: Test
uses: ./repo/.github/actions/test-product
with:
Thumbprint: ${{ steps.get-thumbprint.outputs.thumbprint }}
Alias: Ent_Tenant3
TestParams: ${{ secrets.TestParams }}
Ent_Tenant3_G5:
name: Ent_Tenant3_G5
runs-on: windows-latest
environment: Development
permissions:
id-token: write
contents: write
if: ${{ always() }}
needs:
- Ent_Tenant3
concurrency:
group: Entra_Tenant3
cancel-in-progress: false
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
path: repo
- name: Import PFX
uses: ./repo/.github/actions/import-pfx
with:
PfxBase64: ${{ secrets.PfxBase64 }}
PfxPassword: ${{ secrets.PfxPassword }}
- name: Get Thumbprint
id: get-thumbprint
uses: ./repo/.github/actions/get-thumbprint
with:
PfxPassword: ${{ secrets.PfxPassword }}
- name: Restore ScubaGear
uses: actions/cache/restore@v4
with:
path: C:\Program Files\WindowsPowerShell\Modules\ScubaGear
key: scubagear-directory-
- name: Restore Dependencies
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: powershell-directory-
- name: Restore OPA
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\.scubagear\Tools
key: opa-directory-
- name: Test
uses: ./repo/.github/actions/test-product
with:
Thumbprint: ${{ steps.get-thumbprint.outputs.thumbprint }}
Alias: Ent_Tenant3_G5
TestParams: ${{ secrets.TestParams }}
Ent_Tenant6:
name: Ent_Tenant6
runs-on: windows-latest
environment: Development
permissions:
id-token: write
contents: write
concurrency:
group: Entra_Tenant6
cancel-in-progress: false
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
path: repo
- name: Import PFX
uses: ./repo/.github/actions/import-pfx
with:
PfxBase64: ${{ secrets.PfxBase64 }}
PfxPassword: ${{ secrets.PfxPassword }}
- name: Get Thumbprint
id: get-thumbprint
uses: ./repo/.github/actions/get-thumbprint
with:
PfxPassword: ${{ secrets.PfxPassword }}
- name: Restore ScubaGear
uses: actions/cache/restore@v4
with:
path: C:\Program Files\WindowsPowerShell\Modules\ScubaGear
key: scubagear-directory-
- name: Restore Dependencies
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: powershell-directory-
- name: Restore OPA
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\.scubagear\Tools
key: opa-directory-
- name: Test
uses: ./repo/.github/actions/test-product
with:
Thumbprint: ${{ steps.get-thumbprint.outputs.thumbprint }}
Alias: Ent_Tenant6
TestParams: ${{ secrets.TestParams }}
Ent_Tenant6_G5:
name: Ent_Tenant6_G5
runs-on: windows-latest
environment: Development
permissions:
id-token: write
contents: write
if: ${{ always() }}
needs:
- Ent_Tenant6
concurrency:
group: Entra_Tenant6
cancel-in-progress: false
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
path: repo
- name: Import PFX
uses: ./repo/.github/actions/import-pfx
with:
PfxBase64: ${{ secrets.PfxBase64 }}
PfxPassword: ${{ secrets.PfxPassword }}
- name: Get Thumbprint
id: get-thumbprint
uses: ./repo/.github/actions/get-thumbprint
with:
PfxPassword: ${{ secrets.PfxPassword }}
- name: Restore ScubaGear
uses: actions/cache/restore@v4
with:
path: C:\Program Files\WindowsPowerShell\Modules\ScubaGear
key: scubagear-directory-
- name: Restore Dependencies
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: powershell-directory-
- name: Restore OPA
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\.scubagear\Tools
key: opa-directory-
- name: Test
uses: ./repo/.github/actions/test-product
with:
Thumbprint: ${{ steps.get-thumbprint.outputs.thumbprint }}
Alias: Ent_Tenant6_G5
TestParams: ${{ secrets.TestParams }}
email:
name: Email
runs-on: windows-latest
needs:
- Ent_Tenant1
- Ent_Tenant1_G5
- Ent_Tenant2
- Ent_Tenant2_G3
- Ent_Tenant3
- Ent_Tenant3_G5
- Ent_Tenant6
- Ent_Tenant6_G5
if: ${{ failure() && (inputs.EmailOnFailure || inputs.GitHubEventName == 'schedule') }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Extract Email
id: extract-email
uses: ./.github/actions/extract-email
env:
# Could use any of previous jobs as the alias
Alias: Ent_Tenant1
TestParams: ${{ secrets.TestParams }}
- name: Notify on Failure
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.NotifierUsername }}
password: ${{ secrets.NotifierPassword }}
subject: ScubaGear Functional Test Failure
to: ${{ steps.extract-email.outputs.emails }}
from: ScubaGear Notifier
body: This workflow failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}