chore(deps): bump actions/checkout from 5 to 6 #157
This file contains hidden or 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: 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@v6 | |
| - 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@v5 | |
| 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 | |
| } |