Skip to content

Commit 30bf28d

Browse files
🩹 [Patch]: Separate Docs from Build (#135)
## Description This pull request includes updating the reusable workflows for CI and CD, separating documentation generation to a separate stage, using [`Document-PSModule`](https://github.com/PSModule/Document-PSModule/) and updating the [`Build-PSModule`](https://github.com/PSModule/Build-PSModule/) version to the latest which does not have the documentation steps in it. ### Workflow and Documentation Updates: * Updated `Build-PSModule` action from version 2 to version 3. * Added a new `BuildDocs` job to the workflows to generate documentation. * Changed the `LintDocs` job to depend on the new `BuildDocs` job instead of `BuildModule`. * Updated the README to include the new `Document` step in the workflow description and updated the testing environments. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent d9c5f88 commit 30bf28d

File tree

7 files changed

+80
-17
lines changed

7 files changed

+80
-17
lines changed

.github/workflows/CI.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,39 @@ jobs:
219219
Version: ${{ inputs.Version }}
220220

221221
- name: Build module
222-
uses: PSModule/Build-PSModule@v2
222+
uses: PSModule/Build-PSModule@v3
223+
with:
224+
Name: ${{ inputs.Name }}
225+
Path: ${{ inputs.Path }}
226+
ModulesOutputPath: ${{ inputs.ModulesOutputPath }}
227+
Debug: ${{ inputs.Debug }}
228+
Prerelease: ${{ inputs.Prerelease }}
229+
Verbose: ${{ inputs.Verbose }}
230+
Version: ${{ inputs.Version }}
231+
232+
BuildDocs:
233+
name: Build docs
234+
needs:
235+
- BuildModule
236+
runs-on: ubuntu-latest
237+
steps:
238+
- name: Checkout Code
239+
uses: actions/checkout@v4
240+
241+
- name: Debug
242+
if: ${{ inputs.Debug }}
243+
uses: PSModule/Debug@v0
244+
245+
- name: Initialize environment
246+
uses: PSModule/Initialize-PSModule@v1
247+
with:
248+
Debug: ${{ inputs.Debug }}
249+
Prerelease: ${{ inputs.Prerelease }}
250+
Verbose: ${{ inputs.Verbose }}
251+
Version: ${{ inputs.Version }}
252+
253+
- name: Document module
254+
uses: PSModule/Document-PSModule@v0
223255
with:
224256
Name: ${{ inputs.Name }}
225257
Path: ${{ inputs.Path }}
@@ -513,8 +545,8 @@ jobs:
513545

514546
LintDocs:
515547
name: Lint documentation
516-
if: ${{ needs.BuildModule.result == 'success' && !cancelled() }}
517-
needs: BuildModule
548+
if: ${{ needs.BuildDocs.result == 'success' && !cancelled() }}
549+
needs: BuildDocs
518550
runs-on: ubuntu-latest
519551
steps:
520552
- name: Checkout Code

.github/workflows/workflow.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,39 @@ jobs:
226226
Version: ${{ inputs.Version }}
227227

228228
- name: Build module
229-
uses: PSModule/Build-PSModule@v2
229+
uses: PSModule/Build-PSModule@v3
230+
with:
231+
Name: ${{ inputs.Name }}
232+
Path: ${{ inputs.Path }}
233+
ModulesOutputPath: ${{ inputs.ModulesOutputPath }}
234+
Debug: ${{ inputs.Debug }}
235+
Prerelease: ${{ inputs.Prerelease }}
236+
Verbose: ${{ inputs.Verbose }}
237+
Version: ${{ inputs.Version }}
238+
239+
BuildDocs:
240+
name: Build docs
241+
needs:
242+
- BuildModule
243+
runs-on: ubuntu-latest
244+
steps:
245+
- name: Checkout Code
246+
uses: actions/checkout@v4
247+
248+
- name: Debug
249+
if: ${{ inputs.Debug }}
250+
uses: PSModule/Debug@v0
251+
252+
- name: Initialize environment
253+
uses: PSModule/Initialize-PSModule@v1
254+
with:
255+
Debug: ${{ inputs.Debug }}
256+
Prerelease: ${{ inputs.Prerelease }}
257+
Verbose: ${{ inputs.Verbose }}
258+
Version: ${{ inputs.Version }}
259+
260+
- name: Document module
261+
uses: PSModule/Document-PSModule@v0
230262
with:
231263
Name: ${{ inputs.Name }}
232264
Path: ${{ inputs.Path }}
@@ -533,8 +565,8 @@ jobs:
533565

534566
LintDocs:
535567
name: Lint documentation
536-
if: ${{ needs.BuildModule.result == 'success' && !cancelled() }}
537-
needs: BuildModule
568+
if: ${{ needs.BuildDocs.result == 'success' && !cancelled() }}
569+
needs: BuildDocs
538570
runs-on: ubuntu-latest
539571
steps:
540572
- name: Checkout Code

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Process-PSModule
22

3-
A workflow for the PSModule process, stitching together the `Initialize`, `Build`, `Test`, and `Publish` actions to create a complete
3+
A workflow for the PSModule process, stitching together the `Initialize`, `Build`, `Document`, `Test`, and `Publish` actions to create a complete
44
CI/CD pipeline for PowerShell modules. The workflow is used by all PowerShell modules in the PSModule organization.
55

66
## Specifications and practices
@@ -20,13 +20,12 @@ Depending on the labels in the pull requests, the workflow will result in differ
2020

2121
![Process diagram](./media/Process-PSModule.png)
2222

23-
- [Test-PSModule](https://github.com/PSModule/Test-PSModule/) - Tests the source code using PSScriptAnalyzer, PSModule source code tests suites. This runs on 4 different environments to check compatibility.
24-
- PowerShell 7.x on Windows, Ubuntu and macOS.
25-
- Windows PowerShell 5.1 on Windows.
23+
- [Test-PSModule](https://github.com/PSModule/Test-PSModule/) - Tests and lints the source code. This runs on 3 different environments to check compatibility.
24+
- PowerShell LTS on Windows, Ubuntu and macOS.
2625
- [Build-PSModule](https://github.com/PSModule/Build-PSModule/) - Compiles the repository into an efficient PowerShell module.
27-
- [Test-PSModule](https://github.com/PSModule/Test-PSModule/) - Tests the compiled module using PSScriptAnalyzer, PSModule module tests and custom module tests from the module repository. This runs on 4 different environments to check compatibility.
28-
- PowerShell 7.x on Windows, Ubuntu and macOS.
29-
- Windows PowerShell 5.1 on Windows.
26+
- [Document-PSModule](https://github.com/PSModule/Document-PSModule/) - Generates documentation and deploys it to GitHub Pages.
27+
- [Test-PSModule](https://github.com/PSModule/Test-PSModule/) - Tests the compiled module. This runs on 4 different environments to check compatibility.
28+
- PowerShell LTS on Windows, Ubuntu and macOS.
3029
- [Publish-PSModule](https://github.com/PSModule/Publish-PSModule/) - Publishes the module to the PowerShell Gallery, docs to GitHub Pages, and creates a release on the GitHub repository.
3130

3231
To use the workflow, create a new file in the `.github/workflows` directory of the module repository and add the following content.

tests/srcTestRepo/src/functions/public/PSModule/Get-PSModuleTest.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Requires -Modules Utilities
2-
#Requires -Modules @{ ModuleName = 'PSSemVer'; RequiredVersion = '1.0.0' }
2+
#Requires -Modules @{ ModuleName = 'PSSemVer'; RequiredVersion = '1.1.4' }
33
#Requires -Modules @{ ModuleName = 'DynamicParams'; ModuleVersion = '1.1.8' }
44
#Requires -Modules @{ ModuleName = 'Store'; ModuleVersion = '0.3.1' }
55

tests/srcTestRepo/src/functions/public/PSModule/New-PSModuleTest.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Requires -Modules @{ModuleName='PSSemVer'; ModuleVersion='1.0'}
1+
#Requires -Modules @{ModuleName='PSSemVer'; ModuleVersion='1.1.4'}
22

33
function New-PSModuleTest {
44
<#

tests/srcWithManifestTestRepo/src/functions/public/PSModule/Get-PSModuleTest.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Requires -Modules Utilities
2-
#Requires -Modules @{ ModuleName = 'PSSemVer'; RequiredVersion = '1.0.0' }
2+
#Requires -Modules @{ ModuleName = 'PSSemVer'; RequiredVersion = '1.1.4' }
33
#Requires -Modules @{ ModuleName = 'DynamicParams'; ModuleVersion = '1.1.8' }
44
#Requires -Modules @{ ModuleName = 'Store'; ModuleVersion = '0.3.1' }
55

tests/srcWithManifestTestRepo/src/functions/public/PSModule/New-PSModuleTest.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Requires -Modules @{ModuleName='PSSemVer'; ModuleVersion='1.0'}
1+
#Requires -Modules @{ModuleName='PSSemVer'; ModuleVersion='1.1.4'}
22

33
function New-PSModuleTest {
44
<#

0 commit comments

Comments
 (0)