From 62466c3ddde7062abbe1d96cb3e15bc21928c382 Mon Sep 17 00:00:00 2001 From: James Prial Date: Sun, 25 Jan 2026 17:57:28 -0500 Subject: [PATCH 1/2] ci: add GitHub Actions BATS test workflow Adds automated testing workflow that runs BATS tests on push and pull requests across Ubuntu and macOS matrix, with necessary dependencies (bats, jq, yq). Co-Authored-By: Claude Opus 4.5 --- .github/workflows/test.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..33e4468 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: Tests + +on: + push: + branches: ['**'] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies (macOS) + if: runner.os == 'macOS' + run: brew install bats-core jq yq + + - name: Install dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y bats jq + sudo snap install yq + + - name: Run BATS tests + run: bats --tap bin/tests/*.bats From f05d9974f6eaa6c18b9040f3bca3b3119ead6a4e Mon Sep 17 00:00:00 2001 From: James Prial Date: Sun, 25 Jan 2026 18:00:42 -0500 Subject: [PATCH 2/2] fix: download Mike Farah's yq from official releases on Linux Replace snap installation with direct download of yq binary from GitHub releases to match the Homebrew version used on macOS, ensuring consistent behavior across test environments. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33e4468..71967a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,9 @@ jobs: run: | sudo apt-get update sudo apt-get install -y bats jq - sudo snap install yq + # Install Mike Farah's yq from official releases (matches Homebrew version) + sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 + sudo chmod +x /usr/local/bin/yq - name: Run BATS tests run: bats --tap bin/tests/*.bats