-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (79 loc) · 2.83 KB
/
Copy pathWorkflow-Test-WithManifest.yml
File metadata and controls
89 lines (79 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Workflow-Test [WithManifest]
run-name: 'Workflow-Test [WithManifest] - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}'
on:
workflow_dispatch:
pull_request:
paths:
- '.github/actions/**'
- '.github/workflows/**'
- 'tests/srcWithManifestTestRepo/**'
- '!.github/workflows/Release.yml'
- '!.github/workflows/Linter.yml'
schedule:
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
statuses: write
pages: write
id-token: write
jobs:
WorkflowTestWithManifest:
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
uses: ./.github/workflows/workflow.yml
secrets:
APIKey: ${{ secrets.APIKey }}
TestData: >-
{
"secrets": {
"PSMODULE_TEST_SINGLELINE_SECRET": "${{ secrets.PSMODULE_TEST_SINGLELINE_SECRET }}"
},
"variables": {
"PSMODULE_TEST_VARIABLE": ${{ toJSON(vars.PSMODULE_TEST_VARIABLE) }}
}
}
with:
WorkingDirectory: tests/srcWithManifestTestRepo
ImportantFilePatterns: |
^src/
^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 # v8.0.1
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 = @(
'ms.title: Functions'
'# 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 ($content -notlike "*$snippet*") {
throw "Expected snippet not found in generated root Functions index: $snippet"
}
}