Skip to content

Commit

Permalink
Cleanup workflow and add proper names to jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
DCMattyG committed Aug 22, 2023
1 parent 30f1cc6 commit a966564
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/azure-ipam-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:

jobs:
deploy:
name: Deploy Azure IPAM
runs-on: ubuntu-latest
outputs:
ipamURL: ${{ steps.pwshScript.outputs.ipamURL }}
Expand All @@ -42,7 +43,7 @@ jobs:
# tenant-id: ${{ secrets.AZURE_TENANT_ID }}
# enable-AzPSSession: true

- name: "Azure Login"
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
Expand All @@ -64,7 +65,7 @@ jobs:
run: echo "${{ steps.pwshScript.outputs.ipamSuffix }}"

- name: "Upload Logs"
working-directory: "logs"
working-directory: logs
shell: pwsh
run: |
$dateStamp = (Get-Date -UFormat "%Y-%m-%d_%I-%M-%S_%p").tostring()
Expand All @@ -88,17 +89,19 @@ jobs:
- run: echo "${{ github.job }} status is ${{ job.status }}."

sleep:
name: Sleep for 5 Minutes
runs-on: ubuntu-latest
needs: deploy
steps:
- name: "Test Sleepy Time"
- name: Test Sleepy Time
run: |
echo "Time: $(date +'%T')"
echo "Sleeping for 30 seconds"
sleep 30
echo "Time: $(date +'%T')"
test:
name: Test Azure IPAM via Pester
runs-on: ubuntu-latest
needs: [ deploy, sleep ]
steps:
Expand All @@ -108,7 +111,7 @@ jobs:
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module Az, Pester -AllowClobber -Force
- name: "Azure Login"
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
Expand All @@ -121,16 +124,17 @@ jobs:
tests
- name: Test Azure IPAM via Pester
working-directory: "tests"
working-directory: tests
env:
IPAM_URL: ${{ needs.deploy.outputs.ipamURL }}
IPAM_ENGINE_APP_ID: ${{ needs.deploy.outputs.ipamEngineAppId }}
shell: pwsh
run: |
Import-Module Pester -PassThru
Invoke-Pester -Output Detailed ./azureipam.tests.ps1 -PassThru
cleanup:
name: Cleanup Azure IPAM Deployment
runs-on: ubuntu-latest
needs: [ deploy, sleep, test ]
steps:
Expand All @@ -140,13 +144,13 @@ jobs:
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module Az -AllowClobber -Force
- name: "Azure Login"
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
enable-AzPSSession: true

- name : "Cleanup Azure IPAM Deployment"
- name : Cleanup Azure IPAM Deployment
shell: pwsh
run: |
Remove-AzResourceGroup -Name ${{ needs.deploy.outputs.ipamResourceGroup }} -Force
Expand Down

0 comments on commit a966564

Please sign in to comment.