diff --git a/.github/workflows/Linter.yml b/.github/workflows/Linter.yml index 29948887..d86a841c 100644 --- a/.github/workflows/Linter.yml +++ b/.github/workflows/Linter.yml @@ -2,7 +2,9 @@ name: Linter run-name: "Linter - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}" -on: [pull_request] +on: + pull_request: + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -30,6 +32,7 @@ jobs: FILTER_REGEX_EXCLUDE: 'tests/src(TestRepo|WithManifestTestRepo)/src/classes/public/.*\.ps1$' VALIDATE_BIOME_FORMAT: false VALIDATE_GITHUB_ACTIONS: false + VALIDATE_GITHUB_ACTIONS_ZIZMOR: false VALIDATE_JSCPD: false VALIDATE_JSON_PRETTIER: false VALIDATE_MARKDOWN_PRETTIER: false diff --git a/.github/workflows/Workflow-Test-Default.yml b/.github/workflows/Workflow-Test-Default.yml index 511b4b1c..0806fb62 100644 --- a/.github/workflows/Workflow-Test-Default.yml +++ b/.github/workflows/Workflow-Test-Default.yml @@ -8,6 +8,7 @@ on: paths: - '.github/actions/**' - '.github/workflows/**' + - 'tests/srcTestRepo/**' - '!.github/workflows/Release.yml' - '!.github/workflows/Linter.yml' schedule: @@ -46,3 +47,46 @@ jobs: ^README\.md$ ^\.github/actions/ ^\.github/workflows/(?!Release\.yml$|Linter\.yml$) + + VerifyRootFunctionsIndexDefault: + name: Verify root Functions index [Default] + runs-on: ubuntu-latest + needs: + - WorkflowTestDefault + steps: + - name: Checkout repo + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Download docs artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c + with: + name: docs + path: tests/srcTestRepo/outputs/docs + + - name: Verify root Functions index is published + shell: pwsh + run: | + $path = 'tests/srcTestRepo/outputs/docs/index.md' + if (-not (Test-Path -Path $path)) { + throw 'Expected root Functions index at ' + + 'tests/srcTestRepo/outputs/docs/index.md.' + } + + $content = Get-Content -Path $path -Raw + $expectedSnippets = @( + '# Functions' + 'This landing page is authored from the root of ' + + '`src/functions/public`.' + 'Use it to introduce the module''s function surface ' + + 'before readers drill into each group.' + ) + + foreach ($snippet in $expectedSnippets) { + if (-not $content.Contains($snippet)) { + throw 'Expected snippet not found in generated root ' + + "Functions index: $snippet" + } + } diff --git a/.github/workflows/Workflow-Test-WithManifest.yml b/.github/workflows/Workflow-Test-WithManifest.yml index 82f80f55..e4576760 100644 --- a/.github/workflows/Workflow-Test-WithManifest.yml +++ b/.github/workflows/Workflow-Test-WithManifest.yml @@ -8,6 +8,7 @@ on: paths: - '.github/actions/**' - '.github/workflows/**' + - 'tests/srcWithManifestTestRepo/**' - '!.github/workflows/Release.yml' - '!.github/workflows/Linter.yml' schedule: @@ -46,3 +47,46 @@ jobs: ^README\.md$ ^\.github/actions/ ^\.github/workflows/(?!Release\.yml$|Linter\.yml$) + + VerifyRootFunctionsIndexWithManifest: + name: Verify root Functions index [WithManifest] + runs-on: ubuntu-latest + needs: + - WorkflowTestWithManifest + steps: + - name: Checkout repo + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Download docs artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c + with: + name: docs + path: tests/srcWithManifestTestRepo/outputs/docs + + - name: Verify root Functions index is published + shell: pwsh + run: | + $path = 'tests/srcWithManifestTestRepo/outputs/docs/index.md' + if (-not (Test-Path -Path $path)) { + throw 'Expected root Functions index at ' + + 'tests/srcWithManifestTestRepo/outputs/docs/index.md.' + } + + $content = Get-Content -Path $path -Raw + $expectedSnippets = @( + '# Functions' + 'This landing page is authored from the root of ' + + '`src/functions/public`.' + 'Use it to introduce the module''s function surface ' + + 'before readers drill into each group.' + ) + + foreach ($snippet in $expectedSnippets) { + if (-not $content.Contains($snippet)) { + throw 'Expected snippet not found in generated root ' + + "Functions index: $snippet" + } + } diff --git a/tests/srcTestRepo/src/functions/public/index.md b/tests/srcTestRepo/src/functions/public/index.md new file mode 100644 index 00000000..2d436472 --- /dev/null +++ b/tests/srcTestRepo/src/functions/public/index.md @@ -0,0 +1,9 @@ +--- +description: A fully authored landing page for the exported function surface. +--- + +# Functions + +This landing page is authored from the root of `src/functions/public`. + +Use it to introduce the module's function surface before readers drill into each group. diff --git a/tests/srcWithManifestTestRepo/src/functions/public/index.md b/tests/srcWithManifestTestRepo/src/functions/public/index.md new file mode 100644 index 00000000..2d436472 --- /dev/null +++ b/tests/srcWithManifestTestRepo/src/functions/public/index.md @@ -0,0 +1,9 @@ +--- +description: A fully authored landing page for the exported function surface. +--- + +# Functions + +This landing page is authored from the root of `src/functions/public`. + +Use it to introduce the module's function surface before readers drill into each group.