Skip to content

Commit da1087e

Browse files
Exercise caller concurrency policies in workflow tests
Split each internal caller into retained production and replaceable pull-request jobs while keeping artifact verification reachable after the skipped sibling job. Co-authored-by: Copilot <223556698+Copilot@users.noreply.github.com>
1 parent ea46338 commit da1087e

2 files changed

Lines changed: 94 additions & 20 deletions

File tree

.github/workflows/Workflow-Test-Default.yml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,49 @@ on:
3030
schedule:
3131
- cron: '0 0 * * *'
3232

33-
concurrency:
34-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
35-
cancel-in-progress: false
36-
37-
permissions:
38-
contents: read
39-
pages: write
40-
id-token: write
33+
permissions: {}
4134

4235
jobs:
4336
WorkflowTestDefault:
44-
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
37+
if: ${{ github.event_name != 'pull_request' }}
38+
concurrency:
39+
group: ${{ github.workflow }}-${{ github.ref }}
40+
queue: max
41+
permissions:
42+
contents: read
43+
pages: write
44+
id-token: write
45+
uses: ./.github/workflows/workflow.yml
46+
secrets:
47+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
48+
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
49+
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
50+
TestData: >-
51+
{
52+
"secrets": {
53+
"PSMODULE_TEST_SINGLELINE_SECRET": "${{ secrets.PSMODULE_TEST_SINGLELINE_SECRET }}"
54+
},
55+
"variables": {
56+
"PSMODULE_TEST_VARIABLE": ${{ toJSON(vars.PSMODULE_TEST_VARIABLE) }}
57+
}
58+
}
59+
with:
60+
WorkingDirectory: tests/srcTestRepo
61+
ImportantFilePatterns: |
62+
^tests/srcTestRepo/
63+
^\.github/actions/
64+
^\.github/workflows/(?!Release\.yml$|Linter\.yml$)
65+
66+
WorkflowTestDefaultPullRequest:
67+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
68+
concurrency:
69+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
70+
queue: single
71+
cancel-in-progress: true
72+
permissions:
73+
contents: read
74+
pages: write
75+
id-token: write
4576
uses: ./.github/workflows/workflow.yml
4677
secrets:
4778
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
@@ -64,11 +95,17 @@ jobs:
6495
^\.github/workflows/(?!Release\.yml$|Linter\.yml$)
6596
6697
VerifyRootFunctionsIndexDefault:
67-
if: github.event.action != 'closed'
98+
if: >-
99+
${{ always() && github.event.action != 'closed' &&
100+
(needs.WorkflowTestDefault.result == 'success' ||
101+
needs.WorkflowTestDefaultPullRequest.result == 'success') }}
68102
name: Verify root Functions index [Default]
69103
runs-on: ubuntu-latest
70104
needs:
71105
- WorkflowTestDefault
106+
- WorkflowTestDefaultPullRequest
107+
permissions:
108+
contents: read
72109
steps:
73110
- name: Checkout repo
74111
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

.github/workflows/Workflow-Test-WithManifest.yml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,49 @@ on:
3030
schedule:
3131
- cron: '0 0 * * *'
3232

33-
concurrency:
34-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
35-
cancel-in-progress: false
36-
37-
permissions:
38-
contents: read
39-
pages: write
40-
id-token: write
33+
permissions: {}
4134

4235
jobs:
4336
WorkflowTestWithManifest:
44-
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
37+
if: ${{ github.event_name != 'pull_request' }}
38+
concurrency:
39+
group: ${{ github.workflow }}-${{ github.ref }}
40+
queue: max
41+
permissions:
42+
contents: read
43+
pages: write
44+
id-token: write
45+
uses: ./.github/workflows/workflow.yml
46+
secrets:
47+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
48+
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
49+
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
50+
TestData: >-
51+
{
52+
"secrets": {
53+
"PSMODULE_TEST_SINGLELINE_SECRET": "${{ secrets.PSMODULE_TEST_SINGLELINE_SECRET }}"
54+
},
55+
"variables": {
56+
"PSMODULE_TEST_VARIABLE": ${{ toJSON(vars.PSMODULE_TEST_VARIABLE) }}
57+
}
58+
}
59+
with:
60+
WorkingDirectory: tests/srcWithManifestTestRepo
61+
ImportantFilePatterns: |
62+
^tests/srcWithManifestTestRepo/
63+
^\.github/actions/
64+
^\.github/workflows/(?!Release\.yml$|Linter\.yml$)
65+
66+
WorkflowTestWithManifestPullRequest:
67+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
68+
concurrency:
69+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
70+
queue: single
71+
cancel-in-progress: true
72+
permissions:
73+
contents: read
74+
pages: write
75+
id-token: write
4576
uses: ./.github/workflows/workflow.yml
4677
secrets:
4778
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
@@ -64,11 +95,17 @@ jobs:
6495
^\.github/workflows/(?!Release\.yml$|Linter\.yml$)
6596
6697
VerifyRootFunctionsIndexWithManifest:
67-
if: github.event.action != 'closed'
98+
if: >-
99+
${{ always() && github.event.action != 'closed' &&
100+
(needs.WorkflowTestWithManifest.result == 'success' ||
101+
needs.WorkflowTestWithManifestPullRequest.result == 'success') }}
68102
name: Verify root Functions index [WithManifest]
69103
runs-on: ubuntu-latest
70104
needs:
71105
- WorkflowTestWithManifest
106+
- WorkflowTestWithManifestPullRequest
107+
permissions:
108+
contents: read
72109
steps:
73110
- name: Checkout repo
74111
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

0 commit comments

Comments
 (0)