Skip to content

ci: cover Pester 4 and both supported Windows Server releases #37

ci: cover Pester 4 and both supported Windows Server releases

ci: cover Pester 4 and both supported Windows Server releases #37

Workflow file for this run

---
name: "Test"
"on":
pull_request:
jobs:
lint-unit:
uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main
unit-powershell:
# The reusable lint-unit workflow runs the specs, but the generated-script
# syntax specs skip themselves unless pwsh is present. GitHub's Ubuntu
# images ship PowerShell 7, so run the suite once more here to pick them up.
name: Unit (PowerShell parser available)
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.4", "4.0"]
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Report the PowerShell version in use
run: pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'
- name: Run unit tests
run: bundle exec rake unit
powershell-specs:
# PesterUtil.psm1 is the PowerShell module shipped to the SUT. Its specs
# skip themselves without Pester 5+, so install it explicitly here.
name: PowerShell module specs
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Install Pester
shell: pwsh
run: |
Install-Module Pester -MinimumVersion 5.0.0 -Force -Scope CurrentUser -SkipPublisherCheck
"Pester $((Get-Module -ListAvailable Pester | Sort-Object Version -Descending | Select-Object -First 1).Version)"
- name: Run the PowerShell specs
run: bundle exec rake pester