Skip to content

docs: documentation improvements: #36

docs: documentation improvements:

docs: documentation improvements: #36

Workflow file for this run

name: HomeLab Tests
on:
push:
branches: [main]
paths-ignore:
- "**.md"
- "docs/**"
pull_request:
branches: [main]
paths-ignore:
- "**.md"
- "docs/**"
workflow_dispatch:
inputs:
test_type:
description: "Type of tests to run"
required: true
default: "All"
type: choice
options:
- All
- Unit
- Integration
- Workflow
jobs:
test:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install required modules
shell: pwsh
run: |
Write-Host "Installing PowerShell modules..."
Install-Module -Name Pester -Force -SkipPublisherCheck
Install-Module -Name Az.Accounts -Force -SkipPublisherCheck
Install-Module -Name Az.Resources -Force -SkipPublisherCheck
Install-Module -Name Az.Network -Force -SkipPublisherCheck
Install-Module -Name Az.Websites -Force -SkipPublisherCheck
Install-Module -Name Az.Dns -Force -SkipPublisherCheck
Install-Module -Name PowerShell-Yaml -Force -SkipPublisherCheck
Write-Host "Module installation completed."
- name: Run tests
shell: pwsh
run: |
$testType = '${{ github.event.inputs.test_type }}'
if ([string]::IsNullOrEmpty($testType)) {
$testType = 'All'
}
Write-Host "Running $testType tests..."
cd tests
./Run-HomeLab-Tests.ps1 -TestType $testType -GenerateReport
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
tests/TestResults.xml
tests/TestReport.html
- name: Display test summary
if: always()
shell: pwsh
run: |
if (Test-Path "tests/TestResults.xml") {
Write-Host "Test results available in artifacts" -ForegroundColor Green
} else {
Write-Host "No test results file found" -ForegroundColor Yellow
}