|
62 | 62 | permissions: |
63 | 63 | contents: read # to checkout the repo and create releases on the repo |
64 | 64 |
|
| 65 | +env: |
| 66 | + TEST_APP_ENT_CLIENT_ID: ${{ secrets.TEST_APP_ENT_CLIENT_ID }} |
| 67 | + TEST_APP_ENT_PRIVATE_KEY: ${{ secrets.TEST_APP_ENT_PRIVATE_KEY }} |
| 68 | + TEST_APP_ORG_CLIENT_ID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }} |
| 69 | + TEST_APP_ORG_PRIVATE_KEY: ${{ secrets.TEST_APP_ORG_PRIVATE_KEY }} |
| 70 | + TEST_USER_ORG_FG_PAT: ${{ secrets.TEST_USER_ORG_FG_PAT }} |
| 71 | + TEST_USER_USER_FG_PAT: ${{ secrets.TEST_USER_USER_FG_PAT }} |
| 72 | + TEST_USER_PAT: ${{ secrets.TEST_USER_PAT }} |
| 73 | + GITHUB_TOKEN: ${{ github.token }} |
| 74 | + |
65 | 75 | jobs: |
66 | 76 | BeforeAll-ModuleLocal: |
67 | 77 | name: BeforeAll-ModuleLocal |
|
75 | 85 |
|
76 | 86 | - name: Run BeforeAll Setup Scripts |
77 | 87 | uses: PSModule/GitHub-Script@v1 |
78 | | - env: |
79 | | - TEST_APP_ENT_CLIENT_ID: ${{ secrets.TEST_APP_ENT_CLIENT_ID }} |
80 | | - TEST_APP_ENT_PRIVATE_KEY: ${{ secrets.TEST_APP_ENT_PRIVATE_KEY }} |
81 | | - TEST_APP_ORG_CLIENT_ID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }} |
82 | | - TEST_APP_ORG_PRIVATE_KEY: ${{ secrets.TEST_APP_ORG_PRIVATE_KEY }} |
83 | | - TEST_USER_ORG_FG_PAT: ${{ secrets.TEST_USER_ORG_FG_PAT }} |
84 | | - TEST_USER_USER_FG_PAT: ${{ secrets.TEST_USER_USER_FG_PAT }} |
85 | | - TEST_USER_PAT: ${{ secrets.TEST_USER_PAT }} |
86 | | - GITHUB_TOKEN: ${{ github.token }} |
87 | 88 | with: |
88 | 89 | Name: BeforeAll-ModuleLocal |
89 | 90 | ShowInfo: false |
@@ -122,13 +123,13 @@ jobs: |
122 | 123 |
|
123 | 124 | foreach ($folder in $allTestFolders) { |
124 | 125 | $beforeAllScript = Join-Path $folder "BeforeAll.ps1" |
125 | | - |
| 126 | +
|
126 | 127 | if (Test-Path $beforeAllScript -PathType Leaf) { |
127 | 128 | # Get unique directory path to avoid duplicate execution |
128 | 129 | $uniqueDirectory = Resolve-Path $folder -Relative |
129 | 130 | if ($processedDirectories -notcontains $uniqueDirectory) { |
130 | 131 | $processedDirectories += $uniqueDirectory |
131 | | - |
| 132 | +
|
132 | 133 | Write-Host "Running BeforeAll setup script: $beforeAllScript" |
133 | 134 | try { |
134 | 135 | Push-Location $folder |
@@ -189,15 +190,6 @@ jobs: |
189 | 190 |
|
190 | 191 | - name: Test-ModuleLocal |
191 | 192 | uses: PSModule/Invoke-Pester@v4 |
192 | | - env: |
193 | | - TEST_APP_ENT_CLIENT_ID: ${{ secrets.TEST_APP_ENT_CLIENT_ID }} |
194 | | - TEST_APP_ENT_PRIVATE_KEY: ${{ secrets.TEST_APP_ENT_PRIVATE_KEY }} |
195 | | - TEST_APP_ORG_CLIENT_ID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }} |
196 | | - TEST_APP_ORG_PRIVATE_KEY: ${{ secrets.TEST_APP_ORG_PRIVATE_KEY }} |
197 | | - TEST_USER_ORG_FG_PAT: ${{ secrets.TEST_USER_ORG_FG_PAT }} |
198 | | - TEST_USER_USER_FG_PAT: ${{ secrets.TEST_USER_USER_FG_PAT }} |
199 | | - TEST_USER_PAT: ${{ secrets.TEST_USER_PAT }} |
200 | | - GITHUB_TOKEN: ${{ github.token }} # Used in tests! |
201 | 193 | with: |
202 | 194 | Debug: ${{ inputs.Debug }} |
203 | 195 | Prerelease: ${{ inputs.Prerelease }} |
@@ -233,15 +225,6 @@ jobs: |
233 | 225 | - name: Run AfterAll Teardown Scripts |
234 | 226 | if: always() |
235 | 227 | uses: PSModule/GitHub-Script@v1 |
236 | | - env: |
237 | | - TEST_APP_ENT_CLIENT_ID: ${{ secrets.TEST_APP_ENT_CLIENT_ID }} |
238 | | - TEST_APP_ENT_PRIVATE_KEY: ${{ secrets.TEST_APP_ENT_PRIVATE_KEY }} |
239 | | - TEST_APP_ORG_CLIENT_ID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }} |
240 | | - TEST_APP_ORG_PRIVATE_KEY: ${{ secrets.TEST_APP_ORG_PRIVATE_KEY }} |
241 | | - TEST_USER_ORG_FG_PAT: ${{ secrets.TEST_USER_ORG_FG_PAT }} |
242 | | - TEST_USER_USER_FG_PAT: ${{ secrets.TEST_USER_USER_FG_PAT }} |
243 | | - TEST_USER_PAT: ${{ secrets.TEST_USER_PAT }} |
244 | | - GITHUB_TOKEN: ${{ github.token }} |
245 | 228 | with: |
246 | 229 | Name: AfterAll-ModuleLocal |
247 | 230 | ShowInfo: false |
@@ -280,13 +263,13 @@ jobs: |
280 | 263 |
|
281 | 264 | foreach ($folder in $allTestFolders) { |
282 | 265 | $afterAllScript = Join-Path $folder "AfterAll.ps1" |
283 | | - |
| 266 | +
|
284 | 267 | if (Test-Path $afterAllScript -PathType Leaf) { |
285 | 268 | # Get unique directory path to avoid duplicate execution |
286 | 269 | $uniqueDirectory = Resolve-Path $folder -Relative |
287 | 270 | if ($processedDirectories -notcontains $uniqueDirectory) { |
288 | 271 | $processedDirectories += $uniqueDirectory |
289 | | - |
| 272 | +
|
290 | 273 | Write-Host "Running AfterAll teardown script: $afterAllScript" |
291 | 274 | try { |
292 | 275 | Push-Location $folder |
|
0 commit comments