Add new images and favicon for site documentation #1
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: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| shellcheck: | |
| name: shellcheck | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install shellcheck | |
| run: sudo apt-get update && sudo apt-get install -y shellcheck | |
| - name: Run shellcheck on repo shell scripts | |
| run: | | |
| # Lint first-party scripts only. Exclude vendored / subproject dirs | |
| # (pai-web-os, website, node_modules) which have their own | |
| # lint toolchains. | |
| mapfile -t scripts < <(find . \ | |
| -type f -name '*.sh' \ | |
| -not -path './node_modules/*' \ | |
| -not -path './.git/*' \ | |
| -not -path './pai-web-os/*' \ | |
| -not -path './website/*' \ | |
| -not -path './*/node_modules/*' \ | |
| | sort) | |
| echo "Linting ${#scripts[@]} shell scripts (severity: warning)" | |
| printf ' %s\n' "${scripts[@]}" | |
| # SC1091: "not following sourced file" — noisy across includes | |
| # SC2086: "quote to prevent word splitting" — many intentional in live-build | |
| shellcheck \ | |
| --shell=bash \ | |
| --severity=warning \ | |
| --exclude=SC1091,SC2086 \ | |
| "${scripts[@]}" | |
| - name: Run shellcheck on extension-less pai-* CLIs | |
| run: | | |
| # The CLIs we ship in the chroot overlays don't carry a .sh | |
| # suffix, so the previous step's `find -name '*.sh'` misses | |
| # them. Lint them at error severity for now (warnings to be | |
| # cleaned up incrementally and severity raised later). | |
| mapfile -t cli < <(find \ | |
| config/includes.chroot_after_packages/usr/local/bin \ | |
| arm64/config/includes.chroot_after_packages/usr/local/bin \ | |
| -maxdepth 1 -type f -name 'pai-*' 2>/dev/null \ | |
| | sort) | |
| echo "Linting ${#cli[@]} pai-* CLIs (severity: error)" | |
| printf ' %s\n' "${cli[@]}" | |
| shellcheck \ | |
| --shell=bash \ | |
| --severity=error \ | |
| --exclude=SC1091,SC2086 \ | |
| "${cli[@]}" | |
| yamllint: | |
| name: yamllint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install yamllint | |
| run: sudo apt-get update && sudo apt-get install -y yamllint | |
| - name: Run yamllint on CI and repo YAML | |
| run: | | |
| yamllint \ | |
| -d "{extends: default, rules: {line-length: {max: 200}, document-start: disable, truthy: {check-keys: false}, comments: {min-spaces-from-content: 1}, comments-indentation: disable}}" \ | |
| .github/ | |
| powershell: | |
| name: PowerShell (PSScriptAnalyzer + Pester) | |
| runs-on: windows-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install PSScriptAnalyzer and Pester | |
| shell: pwsh | |
| run: | | |
| Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | |
| Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -Force | |
| Install-Module -Name Pester -MinimumVersion 5.5.0 -Scope CurrentUser -Force -SkipPublisherCheck | |
| - name: Run PSScriptAnalyzer (Error + Warning) | |
| shell: pwsh | |
| run: | | |
| $findings = Invoke-ScriptAnalyzer -Path scripts/flash.ps1 -Severity Error,Warning | |
| if ($findings) { | |
| $findings | Format-Table -AutoSize | |
| throw "PSScriptAnalyzer reported $($findings.Count) finding(s)." | |
| } | |
| - name: Run Pester tests | |
| shell: pwsh | |
| run: | | |
| $config = New-PesterConfiguration | |
| $config.Run.Path = 'scripts/flash.ps1.tests.ps1' | |
| $config.Run.Exit = $true | |
| $config.Output.Verbosity = 'Detailed' | |
| Invoke-Pester -Configuration $config | |
| - name: Verify help block | |
| shell: pwsh | |
| run: | | |
| $help = Get-Help -Full scripts/flash.ps1 | |
| if (-not $help.Synopsis) { throw 'Missing .SYNOPSIS' } | |
| if (-not $help.Description) { throw 'Missing .DESCRIPTION' } | |
| $exampleCount = (@($help.Examples.Example)).Count | |
| if ($exampleCount -lt 3) { throw "Expected >=3 .EXAMPLE blocks; got $exampleCount" } | |
| website-build: | |
| name: website build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| defaults: | |
| run: | |
| working-directory: website | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: website/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint website | |
| run: npm run lint | |
| - name: Build website | |
| run: npm run build |