Skip to content

Commit be1a57d

Browse files
Refactor workflow files to use a centralized ActionTestWorkflow and streamline job configurations
1 parent 4f95096 commit be1a57d

File tree

4 files changed

+74
-93
lines changed

4 files changed

+74
-93
lines changed

.github/workflows/Action-Test-Src-Default.yml

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,8 @@ permissions: {}
1616

1717
jobs:
1818
ActionTest:
19-
strategy:
20-
fail-fast: false
21-
matrix:
22-
os: [ubuntu-latest, macos-latest, windows-latest]
23-
name: Action-Test [Src-Default] - [${{ matrix.os }}]
24-
runs-on: ${{ matrix.os }}
25-
steps:
26-
- name: Checkout repo
27-
uses: actions/checkout@v4
28-
29-
- name: Initialize environment
30-
uses: PSModule/Initialize-PSModule@main
31-
32-
- name: Action-Test
33-
uses: ./
34-
id: action-test
35-
env:
36-
GITHUB_TOKEN: ${{ github.token }}
37-
with:
38-
Path: tests/srcTestRepo/src
39-
Settings: SourceCode
40-
41-
- name: Status
42-
shell: pwsh
43-
env:
44-
PASSED: ${{ steps.action-test.outputs.passed }}
45-
run: |
46-
Write-Host "Passed: [$env:PASSED]"
47-
if ($env:PASSED -ne 'true') {
48-
exit 1
49-
}
19+
uses: ./.github/workflows/ActionTestWorkflow.yml
20+
with:
21+
TestType: Src-Default
22+
Path: tests/srcTestRepo/src
23+
Settings: SourceCode

.github/workflows/Action-Test-Src-WithManifest.yml

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,8 @@ permissions: {}
1616

1717
jobs:
1818
ActionTest:
19-
strategy:
20-
fail-fast: false
21-
matrix:
22-
os: [ubuntu-latest, macos-latest, windows-latest]
23-
name: Action-Test [Src-WithManifest] - [${{ matrix.os }}]
24-
runs-on: ${{ matrix.os }}
25-
steps:
26-
- name: Checkout repo
27-
uses: actions/checkout@v4
28-
29-
- name: Initialize environment
30-
uses: PSModule/Initialize-PSModule@main
31-
32-
- name: Action-Test
33-
uses: ./
34-
id: action-test
35-
env:
36-
GITHUB_TOKEN: ${{ github.token }}
37-
with:
38-
Path: tests/srcWithManifestTestRepo/src
39-
Settings: SourceCode
40-
41-
- name: Status
42-
shell: pwsh
43-
env:
44-
PASSED: ${{ steps.action-test.outputs.passed }}
45-
run: |
46-
Write-Host "Passed: [$env:PASSED]"
47-
if ($env:PASSED -ne 'true') {
48-
exit 1
49-
}
19+
uses: ./.github/workflows/ActionTestWorkflow.yml
20+
with:
21+
TestType: Src-WithManifest
22+
Path: tests/srcWithManifestTestRepo/src
23+
Settings: SourceCode

.github/workflows/Action-Test-outputs.yml

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,9 @@ permissions: {}
1616

1717
jobs:
1818
ActionTest:
19-
strategy:
20-
fail-fast: false
21-
matrix:
22-
os: [ubuntu-latest, macos-latest, windows-latest]
23-
name: Action-Test [outputs] - [${{ matrix.os }}]
24-
runs-on: ${{ matrix.os }}
25-
steps:
26-
- name: Checkout repo
27-
uses: actions/checkout@v4
28-
29-
- name: Initialize environment
30-
uses: PSModule/Initialize-PSModule@main
31-
32-
- name: Action-Test
33-
uses: ./
34-
id: action-test
35-
env:
36-
GITHUB_TOKEN: ${{ github.token }}
37-
with:
38-
Path: tests/outputTestRepo/outputs/modules/PSModuleTest
39-
Settings: Module
40-
41-
- name: Status
42-
shell: pwsh
43-
env:
44-
PASSED: ${{ steps.action-test.outputs.passed }}
45-
run: |
46-
Write-Host "Passed: [$env:PASSED]"
47-
if ($env:PASSED -ne 'true') {
48-
exit 1
49-
}
19+
uses: ./.github/workflows/ActionTestWorkflow.yml
20+
with:
21+
TestType: outputs
22+
Path: tests/outputTestRepo/outputs/modules/PSModuleTest
23+
Settings: Module
24+
SettingsFilePath:
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Action-Test [outputs]
2+
3+
run-name: "Action-Test [outputs] - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
TestType:
9+
type: string
10+
required: true
11+
Path:
12+
type: string
13+
required: true
14+
Settings:
15+
type: string
16+
required: false
17+
SettingsFilePath:
18+
type: string
19+
required: false
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
permissions: {}
26+
27+
jobs:
28+
ActionTest:
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
os: [ubuntu-latest, macos-latest, windows-latest]
33+
name: Action-Test [outputs] - [${{ matrix.os }}]
34+
runs-on: ${{ matrix.os }}
35+
steps:
36+
- name: Checkout repo
37+
uses: actions/checkout@v4
38+
39+
- name: Initialize environment
40+
uses: PSModule/Initialize-PSModule@main
41+
42+
- name: Action-Test
43+
uses: ./
44+
id: action-test
45+
with:
46+
Path: ${{ inputs.Path }}
47+
Settings: ${{ inputs.Settings }}
48+
SettingsFilePath: ${{ inputs.SettingsFilePath }}
49+
50+
- name: Status
51+
shell: pwsh
52+
env:
53+
PASSED: ${{ steps.action-test.outputs.passed }}
54+
run: |
55+
Write-Host "Passed: [$env:PASSED]"
56+
if ($env:PASSED -ne 'true') {
57+
exit 1
58+
}

0 commit comments

Comments
 (0)