Add CI workflow to run Pester tests before deployment

This commit is contained in:
2025-04-28 08:21:09 -04:00
parent c5c9f81c50
commit 135af8dfb8

View File

@@ -8,7 +8,26 @@ on:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-22.04
container:
image: catthehacker/ubuntu:pwsh-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Run pester tests and verify all tests pass
shell: pwsh
run: |
Write-Host "Changing to repository directory: ${{ github.workspace }}"
Set-Location -Path ${{ github.workspace }}
Write-Host "Running Pester tests"
Invoke-Pester -Path . -PassThru | Select-Object -ExpandProperty FailedCount | Should -Be 0 -ErrorAction stop
deploy:
needs: test
runs-on: ubuntu-22.04
container:
image: catthehacker/ubuntu:pwsh-latest