-
Notifications
You must be signed in to change notification settings - Fork 46
50 lines (41 loc) · 1.3 KB
/
Copy pathBuild and Test.yml
File metadata and controls
50 lines (41 loc) · 1.3 KB
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
name: Build and Test
on:
pull_request:
branches:
- dev
- master
jobs:
build:
runs-on: windows-latest
permissions: write-all
# Only when run from the main repo
if: github.repository == 'Microsoft365DSC/ReverseDSC'
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Install Modules
shell: pwsh
run: |
Install-PSResource -Name Pester -Scope AllUsers -TrustRepository
- name: Run Pester Tests
shell: pwsh
run: |
$results = Invoke-Pester -Path .\Tests\ReverseDSC.Core.Tests.ps1 -CI -PassThru
if ($results.FailedCount -gt 0)
{
throw "{$($results.FailedCount)} Unit Test(s) Failed"
}
- name: Validate Module Manifest
shell: pwsh
run: |
Test-ModuleManifest -Path ./ReverseDSC.psd1
- name: Validate Module Import
shell: pwsh
run: |
Import-Module ./ReverseDSC.psd1 -Force -ErrorAction Stop
$exportedFunctions = (Get-Module ReverseDSC).ExportedFunctions.Keys
if ($exportedFunctions.Count -eq 0)
{
throw "No functions exported from the ReverseDSC module."
}
Write-Host "Exported functions: $($exportedFunctions -join ', ')"