Add CI pipeline with Github Actions to validate the script #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
test-pwsh: | |
defaults: | |
run: | |
shell: pwsh | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.1.0 | |
- name: Run Pester Tests (pwsh) | |
run: | | |
Write-Output $PSVersionTable.PSVersion.Major $PSVersionTable.PSRemotingProtocolVersion.Minor | |
Set-PSRepository psgallery -InstallationPolicy trusted | |
Install-Module -Name Pester -Confirm:$false -Force | |
Invoke-Pester -Path "./tests" -EnableExit -Show All | |
test-powershell: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.1.0 | |
- name: Run Pester Tests (powershell) | |
shell: powershell | |
run: | | |
Write-Output $PSVersionTable.PSVersion.Major $PSVersionTable.PSRemotingProtocolVersion.Minor | |
Set-PSRepository psgallery -InstallationPolicy trusted | |
Install-Module -Name Pester -Confirm:$false -Force | |
Invoke-Pester -Path "./tests" -Show All |