Action — bats
Installs Bats (Bash Automated Testing System) and runs shell unit tests.
Usage
yaml
steps:
- uses: actions/checkout@v4
with:
submodules: true # required if using bats helpers (bats-support, bats-assert, etc.)
- uses: KevinDeBenedetti/github-workflows/.github/actions/bats@main
with:
tests-dir: tests/Inputs
| Input | Type | Default | Description |
|---|---|---|---|
tests-dir | string | tests/ | Directory (or file) containing .bats test files |
Steps
- Install Bats
1.11.0globally via npm - Run
bats <tests-dir>
Notes
- Pass a specific
.batsfile path totests-dirto run a single test file. - Bats helper libraries (
bats-support,bats-assert,bats-file) are typically added as git submodules — check out withsubmodules: truein your checkout step.