fix: make performance tuning path independent #100
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: 'Syntax Validation' | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| security-events: write | |
| jobs: | |
| powershell-syntax: | |
| runs-on: windows-latest | |
| name: PowerShell Syntax and Regression Validation | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PowerShell 7 | |
| shell: pwsh | |
| run: | | |
| Write-Host "PowerShell version: $($PSVersionTable.PSVersion)" | |
| - name: Install Pester | |
| shell: pwsh | |
| run: | | |
| Install-Module -Name Pester -Force -Scope CurrentUser -SkipPublisherCheck -MinimumVersion 5.0 | |
| - name: Run Syntax Validation Tests | |
| shell: pwsh | |
| run: | | |
| $config = New-PesterConfiguration | |
| $config.Run.Path = '.\tests\syntax-validation.Tests.ps1' | |
| $config.Run.PassThru = $true | |
| $config.Output.Verbosity = 'Detailed' | |
| $result = Invoke-Pester -Configuration $config | |
| if ($result.FailedCount -gt 0) { throw "$($result.FailedCount) syntax test(s) failed" } | |
| - name: Run Bootstrap Regression Tests | |
| shell: pwsh | |
| run: | | |
| $config = New-PesterConfiguration | |
| $config.Run.Path = '.\tests\devmachine-hardening-regression.Tests.ps1' | |
| $config.Run.PassThru = $true | |
| $config.Output.Verbosity = 'Detailed' | |
| $result = Invoke-Pester -Configuration $config | |
| Write-Host "Passed: $($result.PassedCount)" | |
| Write-Host "Failed: $($result.FailedCount)" | |
| if ($result.FailedCount -gt 0) { throw "$($result.FailedCount) bootstrap regression test(s) failed" } | |
| bash-syntax: | |
| runs-on: ubuntu-latest | |
| name: Bash Syntax Validation | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install shellcheck | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y shellcheck | |
| - name: Run shellcheck on bash scripts | |
| run: | | |
| find . -name "*.sh" -type f | xargs shellcheck | |
| - name: Validate bash syntax | |
| run: | | |
| find . -name "*.sh" -type f -exec bash -n {} \; | |
| security-scan: | |
| runs-on: ubuntu-latest | |
| name: Security Scan | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run Trivy vulnerability scanner | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| scan-type: 'fs' | |
| scan-ref: '.' | |
| format: 'sarif' | |
| output: 'trivy-results.sarif' | |
| - name: Upload Trivy scan results to GitHub Security tab | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: 'trivy-results.sarif' | |
| markdown-validation: | |
| runs-on: ubuntu-latest | |
| name: Markdown Validation | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate Markdown files | |
| uses: DavidAnson/markdownlint-cli2-action@v16 | |
| with: | |
| globs: '**/*.md' |