|
1 | | -name: Test AccUnit JUnit XML (msaccess-vcs-build@feature/accunit-download) |
| 1 | +name: Test AccUnit JUnit XML (msaccess-vcs-build@bugfix/build-early-exit-cleanup) |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
15 | 15 | uses: actions/checkout@v4 |
16 | 16 |
|
17 | 17 | - name: "A: Build add-in, AccUnit tests without JUnit XML" |
18 | | - uses: AccessCodeLib/msaccess-vcs-build@feature/accunit-download |
| 18 | + uses: AccessCodeLib/msaccess-vcs-build@bugfix/build-early-exit-cleanup |
19 | 19 | with: |
20 | 20 | source-dir: "source" |
21 | 21 | target-dir: "bin" |
|
24 | 24 | timeout-minutes: 10 |
25 | 25 |
|
26 | 26 | - name: "B: Build DeclDictTester, AccUnit tests with JUnit XML" |
27 | | - uses: AccessCodeLib/msaccess-vcs-build@feature/accunit-download |
| 27 | + uses: AccessCodeLib/msaccess-vcs-build@bugfix/build-early-exit-cleanup |
28 | 28 | with: |
29 | 29 | source-dir: "DeclDictTester.accdb.src" |
30 | 30 | target-dir: "bin" |
|
33 | 33 | accunit-junit-xml: "bin/accunit-results.xml" |
34 | 34 | timeout-minutes: 10 |
35 | 35 |
|
| 36 | + - name: "Count trusted locations before D" |
| 37 | + if: always() |
| 38 | + shell: pwsh |
| 39 | + run: | |
| 40 | + $regPath = "HKCU:\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations" |
| 41 | + $before = @(Get-ChildItem $regPath | Where-Object { $_.PSChildName -like "VCS-build-folder_*" }) |
| 42 | + $before | ForEach-Object { Write-Host "Existing: $($_.PSChildName) = $($_.GetValue('Path'))" } |
| 43 | + "TL_BEFORE=$($before.Count)" | Out-File -FilePath $env:GITHUB_ENV -Append |
| 44 | +
|
| 45 | + - name: "D: Build with invalid accunit-url (must fail, trusted location must be removed)" |
| 46 | + id: invalid_accunit_url |
| 47 | + continue-on-error: true |
| 48 | + uses: AccessCodeLib/msaccess-vcs-build@bugfix/build-early-exit-cleanup |
| 49 | + with: |
| 50 | + source-dir: "DeclDictTester.accdb.src" |
| 51 | + target-dir: "bin-fail" |
| 52 | + file-name: "DeclDictTester.accdb" |
| 53 | + run-accunit-tests: true |
| 54 | + accunit-url: "https://api.github.com/repos/AccessCodeLib/AccUnit/releases/tags/does-not-exist" |
| 55 | + timeout-minutes: 10 |
| 56 | + |
| 57 | + - name: "E: Check result of D and leftover trusted locations" |
| 58 | + if: always() |
| 59 | + shell: pwsh |
| 60 | + run: | |
| 61 | + Write-Host "Outcome of D: ${{ steps.invalid_accunit_url.outcome }}" |
| 62 | + $regPath = "HKCU:\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations" |
| 63 | + $leftover = @(Get-ChildItem $regPath | Where-Object { $_.PSChildName -like "VCS-build-folder_*" }) |
| 64 | + $leftover | ForEach-Object { Write-Host "Existing: $($_.PSChildName) = $($_.GetValue('Path'))" } |
| 65 | + Write-Host "VCS-build-folder trusted locations before D: $env:TL_BEFORE, after D: $($leftover.Count)" |
| 66 | + if ("${{ steps.invalid_accunit_url.outcome }}" -ne "failure") { Write-Error "D did not fail" } |
| 67 | + if ($leftover.Count -gt [int]$env:TL_BEFORE) { Write-Error "D left a trusted location behind" } |
| 68 | +
|
36 | 69 | - name: "Show JUnit XML" |
37 | 70 | if: always() |
38 | 71 | shell: pwsh |
|
0 commit comments