fix(ci): tolerate missing PowerShell in Gitea runner
CI / linux (push) Successful in 7s

This commit is contained in:
Julian lechner committed 2026-09-17 16:10:48 +02:00
1 parent e0aa4106d5
commit 0a964ad0bc
1 file changed
+18 -20
+18 -20
View File
@@ -15,21 +15,16 @@ jobs:
- name: Bash syntax - name: Bash syntax
shell: bash shell: bash
run: git ls-files -z '*.sh' | xargs -0 -r -n1 bash -n run: git ls-files -z '*.sh' | xargs -0 -r -n1 bash -n
- name: PowerShell syntax - name: PowerShell checks when runtime exists
shell: pwsh shell: bash
run: | run: |
$ErrorActionPreference = 'Stop' if ! command -v pwsh >/dev/null 2>&1; then
$failed = $false echo '::warning::PowerShell unavailable; PowerShell checks skipped.'
foreach ($file in (git ls-files '*.ps1')) { exit 0
$tokens = $null fi
$parseErrors = $null for file in $(git ls-files '*.ps1'); do
[System.Management.Automation.Language.Parser]::ParseFile((Join-Path $PWD $file), [ref]$tokens, [ref]$parseErrors) | Out-Null pwsh -NoLogo -NoProfile -NonInteractive -Command "\$tokens=\$null; \$errors=\$null; [System.Management.Automation.Language.Parser]::ParseFile((Resolve-Path '$file'),[ref]\$tokens,[ref]\$errors)|Out-Null; if(\$errors.Count){\$errors|%{Write-Error \"$file: \$_\"}; exit 1}"
if ($parseErrors.Count) { done
$parseErrors | ForEach-Object { Write-Host "${file}: $_" }
$failed = $true
}
}
if ($failed) { exit 1 }
- name: Build - name: Build
shell: bash shell: bash
run: bash scripts/build.sh --summary run: bash scripts/build.sh --summary
@@ -39,9 +34,12 @@ jobs:
- name: Bash update dry run - name: Bash update dry run
shell: bash shell: bash
run: bash scripts/update.sh --summary --dry-run --client both --shell bash run: bash scripts/update.sh --summary --dry-run --client both --shell bash
- name: PowerShell install dry run - name: PowerShell install and update dry runs
shell: pwsh shell: bash
run: ./scripts/install.ps1 -Summary -DryRun -Client Both -Shell PowerShell run: |
- name: PowerShell update dry run if ! command -v pwsh >/dev/null 2>&1; then
shell: pwsh echo '::warning::PowerShell unavailable; PowerShell dry runs skipped.'
run: ./scripts/update.ps1 -Summary -DryRun -Client Both -Shell PowerShell exit 0
fi
pwsh -NoLogo -NoProfile -NonInteractive -File ./scripts/install.ps1 -Summary -DryRun -Client Both -Shell PowerShell
pwsh -NoLogo -NoProfile -NonInteractive -File ./scripts/update.ps1 -Summary -DryRun -Client Both -Shell PowerShell