|
8 | 8 | paths: |
9 | 9 | - '.github/actions/**' |
10 | 10 | - '.github/workflows/**' |
| 11 | + - 'tests/srcWithManifestTestRepo/**' |
11 | 12 | - '!.github/workflows/Release.yml' |
12 | 13 | - '!.github/workflows/Linter.yml' |
13 | 14 | schedule: |
|
46 | 47 | ^README\.md$ |
47 | 48 | ^\.github/actions/ |
48 | 49 | ^\.github/workflows/(?!Release\.yml$|Linter\.yml$) |
| 50 | +
|
| 51 | + VerifyRootFunctionsIndexWithManifest: |
| 52 | + name: Verify root Functions index [WithManifest] |
| 53 | + runs-on: ubuntu-latest |
| 54 | + needs: |
| 55 | + - WorkflowTestWithManifest |
| 56 | + steps: |
| 57 | + - name: Checkout repo |
| 58 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 59 | + with: |
| 60 | + persist-credentials: false |
| 61 | + fetch-depth: 0 |
| 62 | + |
| 63 | + - name: Download docs artifact |
| 64 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c |
| 65 | + with: |
| 66 | + name: docs |
| 67 | + path: tests/srcWithManifestTestRepo/outputs/docs |
| 68 | + |
| 69 | + - name: Verify root Functions index is published |
| 70 | + shell: pwsh |
| 71 | + run: | |
| 72 | + $path = 'tests/srcWithManifestTestRepo/outputs/docs/index.md' |
| 73 | + if (-not (Test-Path -Path $path)) { |
| 74 | + throw 'Expected root Functions index at ' + |
| 75 | + 'tests/srcWithManifestTestRepo/outputs/docs/index.md.' |
| 76 | + } |
| 77 | +
|
| 78 | + $content = Get-Content -Path $path -Raw |
| 79 | + $expectedSnippets = @( |
| 80 | + '# Functions' |
| 81 | + 'This landing page is authored from the root of ' + |
| 82 | + '`src/functions/public`.' |
| 83 | + 'Use it to introduce the module''s function surface ' + |
| 84 | + 'before readers drill into each group.' |
| 85 | + ) |
| 86 | +
|
| 87 | + foreach ($snippet in $expectedSnippets) { |
| 88 | + if (-not $content.Contains($snippet)) { |
| 89 | + throw 'Expected snippet not found in generated root ' + |
| 90 | + "Functions index: $snippet" |
| 91 | + } |
| 92 | + } |
0 commit comments