Skip to content

Commit 7fb9bf7

Browse files
🩹 [Patch]: Add Static code analysis back to the process (#17)
## Description - Add Static code analysis back to the process ## 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 a15a764 commit 7fb9bf7

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed

.github/workflows/workflow.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,40 @@ permissions:
5555
statuses: write
5656

5757
jobs:
58+
TestSourceCode:
59+
name: Test source code
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
shell: [pwsh]
64+
os: [ubuntu-latest, macos-latest, windows-latest]
65+
include:
66+
- shell: powershell
67+
os: windows-latest
68+
runs-on: ${{ matrix.os }}
69+
steps:
70+
- name: Checkout Code
71+
uses: actions/checkout@v4
72+
73+
- name: Initialize environment
74+
uses: PSModule/Initialize-PSModule@v1
75+
with:
76+
Version: ${{ inputs.Version }}
77+
Prerelease: ${{ inputs.Prerelease }}
78+
Shell: ${{ matrix.shell }}
79+
80+
- name: Test built module
81+
uses: PSModule/Test-PSModule@v1
82+
if: ${{ inputs.SkipTests != true }}
83+
with:
84+
Name: ${{ inputs.Name }}
85+
Path: ${{ inputs.Path }}
86+
Shell: ${{ matrix.shell }}
87+
TestType: 'SourceCode'
88+
5889
BuildModule:
5990
name: Build module
91+
needs: TestSourceCode
6092
runs-on: ubuntu-latest
6193
steps:
6294
- name: Checkout Code
@@ -128,6 +160,7 @@ jobs:
128160
Name: ${{ inputs.Name }}
129161
Path: ${{ inputs.ModulesOutputPath }}
130162
Shell: ${{ matrix.shell }}
163+
TestType: 'Module'
131164

132165
LintDocs:
133166
name: Lint documentation

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ The workflow is designed to be trigger on pull requests to the repository's defa
1818
When a pull request is opened, closed, reopened, synchronized (push), or labeled, the workflow will run.
1919
Depending on the labels in the pull requests, the workflow will result in different outcomes.
2020

21+
- [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.
22+
- PowerShell 7.x on Windows, Ubuntu and macOS.
23+
- Windows PowerShell 5.1 on Windows.
2124
- [Build-PSModule](https://github.com/PSModule/Build-PSModule/) - Compiles the repository into an efficient PowerShell module.
22-
- [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.
25+
- [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.
2326
- PowerShell 7.x on Windows, Ubuntu and macOS.
2427
- Windows PowerShell 5.1 on Windows.
2528
- [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.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@{
2-
ModuleVersion = '0.0.0'
3-
RootModule = 'PSModuleTest.psm1'
2+
ModuleVersion = '0.0.0'
3+
RootModule = 'PSModuleTest.psm1'
4+
PowerShellHostName = ''
45
}

0 commit comments

Comments
 (0)