Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,40 @@ permissions:
statuses: write

jobs:
TestSourceCode:
name: Test source code
strategy:
fail-fast: false
matrix:
shell: [pwsh]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- shell: powershell
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Initialize environment
uses: PSModule/Initialize-PSModule@v1
with:
Version: ${{ inputs.Version }}
Prerelease: ${{ inputs.Prerelease }}
Shell: ${{ matrix.shell }}

- name: Test built module
uses: PSModule/Test-PSModule@v1
if: ${{ inputs.SkipTests != true }}
with:
Name: ${{ inputs.Name }}
Path: ${{ inputs.Path }}
Shell: ${{ matrix.shell }}
TestType: 'SourceCode'

BuildModule:
name: Build module
needs: TestSourceCode
runs-on: ubuntu-latest
steps:
- name: Checkout Code
Expand Down Expand Up @@ -128,6 +160,7 @@ jobs:
Name: ${{ inputs.Name }}
Path: ${{ inputs.ModulesOutputPath }}
Shell: ${{ matrix.shell }}
TestType: 'Module'

LintDocs:
name: Lint documentation
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ The workflow is designed to be trigger on pull requests to the repository's defa
When a pull request is opened, closed, reopened, synchronized (push), or labeled, the workflow will run.
Depending on the labels in the pull requests, the workflow will result in different outcomes.

- [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.
- PowerShell 7.x on Windows, Ubuntu and macOS.
- Windows PowerShell 5.1 on Windows.
- [Build-PSModule](https://github.com/PSModule/Build-PSModule/) - Compiles the repository into an efficient PowerShell module.
- [Test-PSModule](https://github.com/PSModule/Test-PSModule/) - Tests the compiled module using PSScriptAnalyzer, PSModule and module tests suites from the module repository. This runs on 4 different environments to check compatibility.
- [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.
- PowerShell 7.x on Windows, Ubuntu and macOS.
- Windows PowerShell 5.1 on Windows.
- [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.
Expand Down
5 changes: 3 additions & 2 deletions tests/src/PSModuleTest/PSModuleTest.psd1
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@{
ModuleVersion = '0.0.0'
RootModule = 'PSModuleTest.psm1'
ModuleVersion = '0.0.0'
RootModule = 'PSModuleTest.psm1'
PowerShellHostName = ''
}