generated from deadlydog/Template.NewGitRepo
-
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.43 KB
/
build-and-test-powershell-module.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-and-test-on-ubuntu:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo source code
uses: actions/checkout@v3
- name: Display PowerShell version being used
shell: pwsh
run: $PSVersionTable
- name: Run Pester Tests
shell: pwsh
run: |
Write-Output "Pester version being used:"
Import-Module -Name Pester
Get-Module -Name Pester
Write-Output "Running all Pester tests in the repo:"
Invoke-Pester
build-and-test-on-windows:
runs-on: windows-latest
steps:
- name: Checkout the repo source code
uses: actions/checkout@v3
- name: Display PowerShell version being used
shell: pwsh
run: $PSVersionTable
- name: Run Pester Tests
shell: pwsh
run: |
Write-Output "Pester version being used:"
Import-Module -Name Pester
Get-Module -Name Pester
Write-Output "Running all Pester tests in the repo:"
$pesterConfig = New-PesterConfiguration @{
Output = @{ Verbosity = 'Detailed' }
TestResult = @{ Enabled = $true }
Run = @{ Exit = $true }
}
Invoke-Pester -Configuration $pesterConfig