Merge branch 'Dev' of https://github.com/microsoft/Microsoft365DSC in… #21
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, pull_request] | |
jobs: | |
# This workflow contains a single job called "build" | |
UnitTests: | |
# The type of runner that the job will run on | |
runs-on: windows-latest | |
permissions: write-all | |
# Only when run from the main repo | |
if: github.repository == 'microsoft/Microsoft365DSC' | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Install Modules | |
shell: pwsh | |
run: | | |
Install-Module ReverseDSC -Force -Scope AllUsers | |
Install-Module DSCParser -Force -Scope AllUsers | |
Install-Module PSDesiredStateConfiguration -Force -Scope AllUsers | |
Install-Module Pester -Force -SkipPublisherCheck -Scope AllUsers | |
[System.Environment]::SetEnvironmentVariable('M365DSCTelemetryEnabled', $false, [System.EnvironmentVariableTarget]::Machine); | |
- name: Run Quality Checks | |
shell: pwsh | |
run: | | |
Import-Module './Tests/TestHarness.psm1' -Force; | |
$MaximumFunctionCount = 32767 | |
try | |
{ | |
$results = Invoke-QualityChecksHarness | |
} | |
catch | |
{ | |
$MaximumFunctionCount = 32767 | |
Import-Module './Tests/TestHarness.psm1' -Force; | |
$results = Invoke-QualityChecksHarness | |
} | |
if ($results.FailedCount -gt 0) | |
{ | |
throw "{$($results.FailedCount)} Quality Check(s) Failed" | |
} | |
- name: Run Test Harness | |
shell: pwsh | |
run: | | |
Import-Module './Tests/TestHarness.psm1' -Force; | |
$MaximumFunctionCount = 32767 | |
try | |
{ | |
$results = Invoke-TestHarness -IgnoreCodeCoverage | |
} | |
catch | |
{ | |
$MaximumFunctionCount = 32767 | |
Import-Module './Tests/TestHarness.psm1' -Force; | |
$results = Invoke-TestHarness -IgnoreCodeCoverage | |
} | |
if ($results.FailedCount -gt 0) | |
{ | |
throw "{$($results.FailedCount)} Unit Test(s) Failed" | |
} |