-
Notifications
You must be signed in to change notification settings - Fork 99
73 lines (62 loc) · 2.32 KB
/
build-validation.yaml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Run pester tests
name: build-validation
on:
workflow_dispatch:
workflow_call:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
permissions:
contents: read
checks: write
jobs:
build-validation:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
- name: Install PowerShell dependencies
shell: pwsh
run: |
Install-Module PSFramework -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber
Install-Module PSModuleDevelopment -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber
Install-Module Microsoft.Graph.Authentication -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber
- name: Install PowerShell dependencies (Windows PowerShell)
if: runner.os == 'Windows'
shell: powershell
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module PSFramework -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber
Install-Module PSModuleDevelopment -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber
Install-Module Microsoft.Graph.Authentication -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber
- name: Run Pester tests
shell: pwsh
run: |
./powershell/tests/pester.ps1
- name: Publish Pester test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Maester Test Results (${{ runner.os }}/PowerShell)
path: TestResults/*.xml
reporter: java-junit
fail-on-error: true
- name: Run Tests using Windows PowerShell
if: runner.os == 'Windows'
shell: powershell
run: |
# Remove old test results
Remove-Item -Path TestResults -Recurse -Force -ErrorAction SilentlyContinue
# Run Pester tests on Windows PowerShell
./powershell/tests/pester.ps1
- name: Publish Pester test results (Windows PowerShell)
uses: dorny/test-reporter@v1
if: runner.os == 'Windows'
with:
name: Maester Test Results Windows PowerShell
path: TestResults/*.xml
reporter: java-junit
fail-on-error: true