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
86 changes: 42 additions & 44 deletions .github/workflows/merge-ci.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,51 @@
# name: Pull Request CI
name: Pull Request CI

# on:
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
# workflow_dispatch:
on:
push:
branches: [ "main" ]
workflow_dispatch:

# jobs:
# lint:
# runs-on: windows-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
jobs:
lint:
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

# - name: Install Modules
# shell: pwsh
# run: |
# Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser
# Install-Module -Name Pester -Force -Scope CurrentUser
# - name: Install Modules
# shell: pwsh
# run: |
# Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser
# Install-Module -Name Pester -Force -Scope CurrentUser

# - name: Test-ModuleManifest
# shell: pwsh
# run: |
# Test-ModuleManifest -Path .\PSMultiPass\PSMultiPass.psd1
- name: Test-ModuleManifest
shell: pwsh
run: |
Test-ModuleManifest -Path .\PSMultiPass\PSMultiPass.psd1

# - name: Run PSScriptAnalyzer
# shell: pwsh
# run: |
# $results = @()
- name: Run PSScriptAnalyzer
shell: pwsh
run: |
$results = @()

# $results += Invoke-ScriptAnalyzer -Path .\PSMultiPass\PSMultiPass.psm1 -Severity Error
# $results += Invoke-ScriptAnalyzer -Path .\PSMultiPass\functions -Recurse -Severity Error
$results += Invoke-ScriptAnalyzer -Path .\PSMultiPass\PSMultiPass.psm1 -Severity Error
$results += Invoke-ScriptAnalyzer -Path .\PSMultiPass\functions -Recurse -Severity Error

# if ($results) {
# $results | Format-Table
# Throw "PSScriptAnalyzer FAILED" # Fail the build if errors are found
# } else {
# Write-Host "PSScriptAnalyzer PASSED" -ForegroundColor Green
# }
if ($results) {
$results | Format-Table
Throw "PSScriptAnalyzer FAILED" # Fail the build if errors are found
} else {
Write-Host "PSScriptAnalyzer PASSED" -ForegroundColor Green
}

# - name: Run Pester Tests
# shell: pwsh
# run: |
# Invoke-Pester -Path .\PSMultiPass\test\ -Output Detailed
- name: Run Pester Tests
shell: pwsh
run: |
Invoke-Pester -Path .\PSMultiPass\test\ -Output Detailed

# - name: Test publish to PowerShell Gallery
# shell: pwsh
# env:
# PSGalleryApiKey: ${{ secrets.PSGALLERY_API_KEY }}
# run: |
# Publish-Module -Path .\PSMultiPass\ -Repository PSGallery -NuGetApiKey $env:PSGalleryApiKey -WhatIf -Verbose
- name: Test publish to PowerShell Gallery
shell: pwsh
env:
PSGalleryApiKey: ${{ secrets.PSGALLERY_API_KEY }}
run: |
Publish-Module -Path .\PSMultiPass\ -Repository PSGallery -NuGetApiKey $env:PSGalleryApiKey -Verbose
12 changes: 7 additions & 5 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Pull Request CI
on:
pull_request:
branches: [ "main" ]
# paths-ignore:
# - '.github/**'
workflow_dispatch:

jobs:
Expand All @@ -12,11 +14,11 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install Modules
shell: pwsh
run: |
Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser
Install-Module -Name Pester -Force -Scope CurrentUser
# - name: Install Modules
# shell: pwsh
# run: |
# Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser
# Install-Module -Name Pester -Force -Scope CurrentUser

- name: Test-ModuleManifest
shell: pwsh
Expand Down
2 changes: 1 addition & 1 deletion PSMultiPass/PSMultiPass.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PSMultiPass.psm1'

# Version number of this module.
ModuleVersion = '0.0.1'
ModuleVersion = '0.0.2'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
Loading