diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a31955b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CI + +on: + push: + branches: [ "**" ] + pull_request: + branches: [ "**" ] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install ShellCheck + run: | + sudo apt-get update + sudo apt-get install -y shellcheck + + - name: Run ShellCheck on all shell scripts + run: | + # Find all *.sh files tracked by git + SH_FILES=$(git ls-files '*.sh') + if [ -z "$SH_FILES" ]; then + echo "No shell script files found." + exit 0 + fi + echo "Running shellcheck on the following files:" + echo "$SH_FILES" + shellcheck $SH_FILES + + - name: Validate Vim configuration syntax + run: | + # Run Vim in headless mode to load syntax highlighting and exit. + # Any syntax errors in Vim configuration files will cause a non‑zero exit. + vim --cmd 'set nomore' -c 'syntax on' -c 'quit' || exit 1 \ No newline at end of file