docs: updating principles #2
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: Lint | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Run pre-commit | |
| uses: pre-commit/action@v3.0.1 | |
| ansible-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Ansible | |
| run: pip install ansible-core ansible-lint | |
| - name: Install Ansible collections | |
| run: ansible-galaxy collection install -r ansible/requirements.yml | |
| - name: Run ansible-lint | |
| run: ansible-lint | |
| powershell-lint: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - name: Check PowerShell script syntax | |
| shell: pwsh | |
| run: | | |
| $errors = @() | |
| Get-ChildItem -Recurse -Filter "*.ps1" | ForEach-Object { | |
| $parseErrors = $null | |
| $null = [System.Management.Automation.Language.Parser]::ParseFile( | |
| $_.FullName, [ref]$null, [ref]$parseErrors | |
| ) | |
| if ($parseErrors.Count -gt 0) { | |
| $errors += "$($_.FullName): $parseErrors" | |
| } | |
| } | |
| if ($errors.Count -gt 0) { | |
| $errors | ForEach-Object { Write-Error $_ } | |
| exit 1 | |
| } | |
| Write-Output "All PowerShell scripts passed syntax check." |