46 lines
1.8 KiB
YAML
46 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
schedule:
|
|
- cron: '23 4 * * 1'
|
|
|
|
jobs:
|
|
linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- name: Bash syntax
|
|
shell: bash
|
|
run: git ls-files -z '*.sh' | xargs -0 -r -n1 bash -n
|
|
- name: PowerShell checks when runtime exists
|
|
shell: bash
|
|
run: |
|
|
if ! command -v pwsh >/dev/null 2>&1; then
|
|
echo '::warning::PowerShell unavailable; PowerShell checks skipped.'
|
|
exit 0
|
|
fi
|
|
for file in $(git ls-files '*.ps1'); do
|
|
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}"
|
|
done
|
|
- name: Build
|
|
shell: bash
|
|
run: bash scripts/build.sh --summary
|
|
- name: Bash install dry run
|
|
shell: bash
|
|
run: bash scripts/install.sh --summary --dry-run --client both --shell bash
|
|
- name: Bash update dry run
|
|
shell: bash
|
|
run: bash scripts/update.sh --summary --dry-run --client both --shell bash
|
|
- name: PowerShell install and update dry runs
|
|
shell: bash
|
|
run: |
|
|
if ! command -v pwsh >/dev/null 2>&1; then
|
|
echo '::warning::PowerShell unavailable; PowerShell dry runs skipped.'
|
|
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
|