Install Pester before running tests

Added a step to install Pester before running tests.
This commit is contained in:
Haritha
2025-11-03 11:53:28 -06:00
committed by GitHub
parent e60ec8ae98
commit 6c48f687bd

View File

@@ -160,12 +160,14 @@ jobs:
Write-Host "to determine if ${{ inputs.tool-name }} version was consumed from cache or if it was downloaded"
for ($i = 0; $i -lt 200; $i++) { Get-Random }
- name: Install Pester
run: Install-Module Pester -Force -Scope CurrentUser -SkipPublisherCheck
- name: Run tests
if: env.excludewinarm == 'true'
env:
VERSION: ${{ inputs.tool-version }}
run: |
Install-Module Pester -Force -Scope CurrentUser -SkipPublisherCheck
Import-Module Pester
$toolName = (Get-Culture).TextInfo.ToTitleCase("${{ inputs.tool-name }}")
Invoke-Pester -Configuration @{
@@ -175,6 +177,21 @@ jobs:
}
working-directory: ./tests
# - name: Run tests
# if: env.excludewinarm == 'true'
# env:
# VERSION: ${{ inputs.tool-version }}
# run: |
# Install-Module Pester -Force -Scope CurrentUser -SkipPublisherCheck
# Import-Module Pester
# $toolName = (Get-Culture).TextInfo.ToTitleCase("${{ inputs.tool-name }}")
# Invoke-Pester -Configuration @{
# Run = @{ Path = "./$toolName.Tests.ps1" }
# Should = @{ ErrorAction = 'Continue' }
# Output = @{ EnableExit = $true }
# }
# working-directory: ./tests
publish_release:
name: Publish release
if: inputs.publish-release