From 5a278ad119d41eb74191f9573e5d54c4dafc0e90 Mon Sep 17 00:00:00 2001 From: Saravanakumar D Date: Fri, 29 May 2026 21:31:00 -0700 Subject: [PATCH] ci: add GitHub Actions CI (shellcheck, syntax, preview) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a849090 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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