Update 201_MicrosoftTeams.ps1 #189
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: "Validate scripts" | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'scripts/image/*.ps1' | |
- 'scripts/tweaks/*.ps1' | |
- 'scripts/uninstall/*.ps1' | |
- 'tests/*.ps1' | |
- '.github/workflows/test-avd.yml' | |
# schedule: | |
# - cron: '0 1 15 * *' #Run on the 15th of each month | |
jobs: | |
test: | |
name: Run tests | |
#needs: pssa | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
#with: | |
#token: ${{ secrets.GH_TOKEN }} | |
- name: Install modules | |
shell: powershell | |
working-directory: "${{ github.workspace }}" | |
run: | | |
.\tests\Install-Modules.ps1 | |
- name: Test with Pester | |
shell: powershell | |
if: always() | |
working-directory: "${{ github.workspace }}" | |
run: | | |
$AzureRegionName = "${{ secrets.AZUREREGIONNAME }}" | |
$SecureVars = @{ VariablesList = "${{ secrets.VARIABLESLIST }}" } | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
$params = @{ | |
Uri = $SecureVars.VariablesList | |
UseBasicParsing = $true | |
ErrorAction = "Stop" | |
} | |
Invoke-RestMethod @params | |
Import-Module -Name "Pester" -Force -ErrorAction "Stop" | |
$Config = New-PesterConfiguration | |
$Config.Run.Path = "$Env:GITHUB_WORKSPACE\tests\scripts" | |
$Config.Run.PassThru = $true | |
$Config.CodeCoverage.Enabled = $true | |
$Config.CodeCoverage.Path = "$Env:GITHUB_WORKSPACE\scripts" | |
$Config.CodeCoverage.OutputFormat = "JaCoCo" | |
$Config.CodeCoverage.OutputPath = "$Env:GITHUB_WORKSPACE\CodeCoverage.xml" | |
$Config.TestResult.Enabled = $true | |
$Config.TestResult.OutputFormat = "NUnitXml" | |
$Config.TestResult.OutputPath = "$Env:GITHUB_WORKSPACE\tests\TestResults.xml" | |
$Config.Output.Verbosity = "Detailed" | |
Invoke-Pester -Configuration $Config | |
# Upload test results | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-results | |
path: "${{ github.workspace }}\\tests\\TestResults.xml" | |
# Publish test results | |
- name: Publish test results | |
uses: EnricoMi/publish-unit-test-result-action/composite@v2 | |
if: always() | |
with: | |
nunit_files: "${{ github.workspace }}\\tests\\TestResults.xml" | |
- name: Upload to Codecov | |
id: codecov | |
if: always() | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./CodeCoverage.xml | |
verbose: true | |
- name: Upload installed apps list | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: installed-applications | |
path: "${{ github.workspace }}\\support\\InstalledApplications.csv" |