ci: add GitHub Actions CI (shellcheck, syntax, preview)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
efe0da3169
commit
5a278ad119
63
.github/workflows/ci.yml
vendored
Normal file
63
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
shellcheck:
|
||||||
|
name: Shellcheck
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install shellcheck
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y shellcheck
|
||||||
|
- name: Run shellcheck on shell scripts
|
||||||
|
run: |
|
||||||
|
files=$(git ls-files '*.sh' || true)
|
||||||
|
if [ -z "$files" ]; then
|
||||||
|
echo "No shell scripts to check"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "$files"
|
||||||
|
shellcheck $files
|
||||||
|
|
||||||
|
syntax:
|
||||||
|
name: Syntax & EOL checks
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Fail on CRLF in scripts
|
||||||
|
run: |
|
||||||
|
CRLF_FILES=$(git ls-files '*.sh' | xargs -r grep -Il $'\r' || true)
|
||||||
|
if [ -n "$CRLF_FILES" ]; then
|
||||||
|
echo "CRLF found in the following files:"; echo "$CRLF_FILES";
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "No CRLF in shell scripts"
|
||||||
|
- name: Bash syntax-check
|
||||||
|
run: |
|
||||||
|
for f in $(git ls-files '*.sh'); do
|
||||||
|
echo "Checking $f";
|
||||||
|
bash -n "$f";
|
||||||
|
done
|
||||||
|
|
||||||
|
preview-runner:
|
||||||
|
name: Preview installer scripts
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Bash syntax-check run_installers
|
||||||
|
run: bash -n run_installers.sh
|
||||||
|
- name: Preview run_installers (safe)
|
||||||
|
run: ./run_installers.sh --preview
|
||||||
|
|
||||||
|
windows-preview:
|
||||||
|
name: PowerShell preview
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Preview PowerShell wrapper
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
./run_installers.ps1 -Preview
|
||||||
Loading…
Reference in New Issue
Block a user