File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ # .github/workflows/ci.yml
2+ name : CI
3+
4+ on :
5+ push :
6+ pull_request :
7+
8+ permissions :
9+ contents : read
10+
11+ concurrency :
12+ group : ci-${{ github.ref }}
13+ cancel-in-progress : true
14+
15+ jobs :
16+ shellcheck :
17+ name : ShellCheck
18+ runs-on : ubuntu-latest
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v6 # :contentReference[oaicite:0]{index=0}
22+ - name : Run ShellCheck
23+ uses : ludeeus/action-shellcheck@2.0.0 # :contentReference[oaicite:1]{index=1}
24+
25+ bats :
26+ name : Bats (${{ matrix.os }})
27+ runs-on : ${{ matrix.os }}
28+ strategy :
29+ fail-fast : false
30+ matrix :
31+ os : [ubuntu-latest, macos-latest]
32+ defaults :
33+ run :
34+ shell : bash
35+ steps :
36+ - name : Checkout
37+ uses : actions/checkout@v6 # :contentReference[oaicite:2]{index=2}
38+
39+ - name : Setup Bats and bats libs
40+ id : setup-bats
41+ uses : bats-core/bats-action@3.0.1 # :contentReference[oaicite:3]{index=3}
42+
43+ - name : Run Bats tests
44+ env :
45+ BATS_LIB_PATH : ${{ steps.setup-bats.outputs.lib-path }}
46+ TERM : xterm
47+ run : |
48+ set -euo pipefail
49+ if [[ -d "test" || -d "tests" ]]; then
50+ args=()
51+ [[ -d "test" ]] && args+=("test")
52+ [[ -d "tests" ]] && args+=("tests")
53+ bats -r "${args[@]}"
54+ else
55+ echo "No ./test or ./tests directory found (expected Bats tests there)."
56+ exit 1
57+ fi
You can’t perform that action at this time.
0 commit comments