|
17 | 17 | - "helper/**"
|
18 | 18 |
|
19 | 19 | workflow_dispatch:
|
| 20 | + inputs: |
| 21 | + doAzCmdDeployment: |
| 22 | + description: 'Test AZ Cmd by deploying to an Azure subscription' |
| 23 | + default: 'false' |
| 24 | + type: boolean |
| 25 | + required: false |
20 | 26 |
|
21 | 27 | env:
|
22 |
| - templateRelease: 0.3.3 |
| 28 | + templateRelease: 0.3.4-preview |
| 29 | + AZCLIVERSION: 2.30.0 #2.29.2 #2.26.0 #latest |
| 30 | + RG: "Automation-Actions-AksPublishCI" |
23 | 31 |
|
24 | 32 | jobs:
|
25 | 33 |
|
@@ -81,12 +89,73 @@ jobs:
|
81 | 89 |
|
82 | 90 | - name: Playwright - Run stable helper tests
|
83 | 91 | env:
|
84 |
| - filenamewordmatch: 'helper' |
| 92 | + filenamewordmatch: 'helper-test' |
85 | 93 | filenamewordexclude: 'fragile'
|
86 | 94 | run: |
|
87 | 95 | cd helper
|
88 | 96 | npx playwright test --browser chromium .playwrighttests/ -g '${{ env.filenamewordmatch }}' --grep-invert '${{ env.filenamewordexclude }}' --reporter list
|
89 | 97 |
|
| 98 | + - name: Playwright - Grab Az Commands |
| 99 | + env: |
| 100 | + filenamewordmatch: 'helper-export' |
| 101 | + run: | |
| 102 | + cd helper |
| 103 | + npx playwright test --browser chromium .playwrighttests/ -g '${{ env.filenamewordmatch }}' --reporter list |
| 104 | +
|
| 105 | + - name: Persist exported Az Commands for visibility |
| 106 | + if: ${{ github.event.pull_request.head.repo.fork }} |
| 107 | + uses: actions/upload-artifact@v2 |
| 108 | + with: |
| 109 | + name: AzCmds |
| 110 | + path: helper/azcmd-*.sh |
| 111 | + |
| 112 | + - name: Azure Login |
| 113 | + if: ${{ !github.event.pull_request.head.repo.fork }} |
| 114 | + uses: Azure/login@v1 |
| 115 | + with: |
| 116 | + creds: ${{ secrets.AZURE_CREDENTIALS }} |
| 117 | + enable-AzPSSession: true |
| 118 | + environment: azurecloud |
| 119 | + allow-no-subscriptions: false |
| 120 | + |
| 121 | + #TODO: If/When we capture more AZ CMD's, then we'll want to iterate over files beginning with "azcmd" |
| 122 | + - name: Verify AZ Commands |
| 123 | + if: ${{ !github.event.pull_request.head.repo.fork }} |
| 124 | + |
| 125 | + env: |
| 126 | + azcmdpath: "helper/azcmd-managed-private.sh" |
| 127 | + with: |
| 128 | + azcliversion: ${{ env.AZCLIVERSION }} |
| 129 | + inlineScript: | |
| 130 | + #Change the Create to a Validate statement |
| 131 | + sed -i 's/az deployment group create/az deployment group validate/' $azcmdpath |
| 132 | +
|
| 133 | + #Debug |
| 134 | + cat $azcmdpath |
| 135 | +
|
| 136 | + #Run the script |
| 137 | + sh $azcmdpath |
| 138 | +
|
| 139 | + - name: Full deploy test AZ Commands |
| 140 | + if: ${{ !github.event.pull_request.head.repo.fork && github.event.inputs.doAzCmdDeployment == 'true' }} |
| 141 | + |
| 142 | + env: |
| 143 | + azcmdpath: "helper/azcmd-managed-private.sh" |
| 144 | + with: |
| 145 | + azcliversion: ${{ env.AZCLIVERSION }} |
| 146 | + inlineScript: | |
| 147 | + #Change the Create to a Validate statement |
| 148 | + sed -i 's/az deployment group validate/az deployment group create --mode Complete --name ghpages/' $azcmdpath |
| 149 | +
|
| 150 | + #Debug |
| 151 | + cat $azcmdpath |
| 152 | +
|
| 153 | + #Run the script |
| 154 | + sh $azcmdpath |
| 155 | +
|
| 156 | + #Cleanup |
| 157 | + #az deploymentg group delete -n ghpages -g $RG |
| 158 | +
|
90 | 159 | - name: Persist test failure screengrabs as artifacts
|
91 | 160 | uses: actions/upload-artifact@v2
|
92 | 161 | if: failure()
|
|
0 commit comments