Skip to content

Commit

Permalink
Add PowerShell dependencies and run Pester tests
Browse files Browse the repository at this point in the history
  • Loading branch information
f-bader committed Apr 1, 2024
1 parent 346021b commit b7131d9
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions .github/workflows/build-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,51 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Run Pester tests

- 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: pwsh
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
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
fail-on-error: true

0 comments on commit b7131d9

Please sign in to comment.