File tree Expand file tree Collapse file tree 2 files changed +34
-13
lines changed
Expand file tree Collapse file tree 2 files changed +34
-13
lines changed Original file line number Diff line number Diff line change 77# For more information on PSScriptAnalyzer in general, see
88# https://github.com/PowerShell/PSScriptAnalyzer
99
10- name : PSScriptAnalyzer
10+ name : Powershell CI
1111
1212on :
1313 push :
2727 security-events : write # for github/codeql-action/upload-sarif to upload SARIF results
2828 actions : read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
2929 name : PSScriptAnalyzer
30- runs-on : ubuntu -latest
30+ runs-on : windows -latest
3131 steps :
3232 - uses : actions/checkout@v4
3333
4747 uses : github/codeql-action/upload-sarif@v3
4848 with :
4949 sarif_file : results.sarif
50+
51+ # Run the tests
52+ - name : Install Pester
53+ shell : powershell
54+ run : |
55+ Install-Module -Name Pester -Force -Scope CurrentUser
56+
57+ - name : Run Pester Tests
58+ shell : powershell
59+ run : |
60+ $modules = Get-ChildItem -Directory -Path ./src
61+ foreach ($module in $modules) {
62+ $testPath = Join-Path $module.FullName 'Tests'
63+ if (Test-Path $testPath) {
64+ "Running tests for module: $($module.Name)..."
65+ Invoke-Pester -Path $testPath -Output Detailed
66+ } else {
67+ "No tests found for module: $($module.Name). Skipping."
68+ }
69+ }
Original file line number Diff line number Diff line change 1- # This is a basic workflow to help you get started with Actions
2-
31name : publish-to-psgallery
42
5- # Controls when the workflow will run
63on :
7- # Triggers the workflow on push or pull request events but only for the "main" branch
8- push :
9- branches : [ "main" ]
4+ workflow_run :
5+ workflows : ["PowerShell CI"]
6+ types :
7+ - completed
108
119 # Allows you to run this workflow manually from the Actions tab
1210 workflow_dispatch :
1311
14- # A workflow run is made up of one or more jobs that can run sequentially or in parallel
1512jobs :
16- # This workflow contains a single job called "build"
17- build :
18- # The type of runner that the job will run on
13+ publish :
14+ if : >-
15+ ${{
16+ github.event.workflow_run.conclusion == 'success' &&
17+ github.event.workflow_run.head_branch == 'main' &&
18+ github.event.workflow_run.event == 'push'
19+ }}
20+
1921 runs-on : ubuntu-latest
2022
21- # Steps represent a sequence of tasks that will be executed as part of the job
2223 steps :
2324 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2425 - uses : actions/checkout@v4
You can’t perform that action at this time.
0 commit comments