-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (34 loc) · 1.08 KB
/
Copy pathci-bash.yml
File metadata and controls
38 lines (34 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: ci-bash
on:
push:
pull_request:
permissions:
contents: read
jobs:
bash-sanity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bash syntax check
shell: bash
run: |
set -euo pipefail
shopt -s globstar nullglob
for f in **/*.sh; do
echo "Checking syntax: $f"
bash -n "$f"
done
- name: Help standard check (-h)
shell: bash
run: |
set -euo pipefail
for f in conduit-console.sh conduit-optimizer.sh; do
if [[ -f "$f" ]]; then
echo "Checking help for: $f"
out="$("./$f" -h 2>/dev/null || true)"
[[ -n "$out" ]] || { echo "Missing -h output in $f"; exit 1; }
echo "$out" | grep -qi "Usage" || { echo "Help missing Usage in $f"; exit 1; }
echo "$out" | grep -qi "Options" || { echo "Help missing Options in $f"; exit 1; }
echo "$out" | grep -qi "Example" || { echo "Help missing Examples in $f"; exit 1; }
fi
done