From a23b1d7a10256fa0c90f2bc9934d3f67852c2113 Mon Sep 17 00:00:00 2001 From: Deploy Bot Date: Thu, 17 Jul 2025 20:59:13 -0400 Subject: [PATCH] Fix BATS helper library paths and update workflow --- .github/workflows/test.yml | 24 ++++++++++++------------ tests/parser.bats | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3b883d..7dd3708 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,28 +38,28 @@ jobs: sudo ./bats-core/install.sh /usr/local fi - # Install bats-support and bats-assert in a standard location - BATS_HELPER_PATH="/usr/local/lib/bats-helpers" - sudo mkdir -p $BATS_HELPER_PATH + # Install bats-support and bats-assert in a local directory + BATS_HELPER_PATH="$GITHUB_WORKSPACE/bats-helpers" + mkdir -p "$BATS_HELPER_PATH" - # Clone and install bats-support + # Clone bats-support if [ ! -d "$BATS_HELPER_PATH/bats-support" ]; then - git clone https://github.com/bats-core/bats-support.git /tmp/bats-support --depth 1 - sudo mv /tmp/bats-support $BATS_HELPER_PATH/ + git clone https://github.com/bats-core/bats-support.git "$BATS_HELPER_PATH/bats-support" --depth 1 fi - # Clone and install bats-assert + # Clone bats-assert if [ ! -d "$BATS_HELPER_PATH/bats-assert" ]; then - git clone https://github.com/bats-core/bats-assert.git /tmp/bats-assert --depth 1 - sudo mv /tmp/bats-assert $BATS_HELPER_PATH/ + git clone https://github.com/bats-core/bats-assert.git "$BATS_HELPER_PATH/bats-assert" --depth 1 fi - # Clone and install bats-file + # Clone bats-file if [ ! -d "$BATS_HELPER_PATH/bats-file" ]; then - git clone https://github.com/bats-core/bats-file.git /tmp/bats-file --depth 1 - sudo mv /tmp/bats-file $BATS_HELPER_PATH/ + git clone https://github.com/bats-core/bats-file.git "$BATS_HELPER_PATH/bats-file" --depth 1 fi + # Export the path for use in tests + echo "BATS_LIB_PATH=$BATS_HELPER_PATH" >> $GITHUB_ENV + - name: Set up SSH run: | # Create .ssh directory diff --git a/tests/parser.bats b/tests/parser.bats index 553c845..918a763 100755 --- a/tests/parser.bats +++ b/tests/parser.bats @@ -1,7 +1,7 @@ #!/usr/bin/env bats # Load BATS helper libraries -export BATS_LIB_PATH="/usr/local/lib/bats-helpers" +export BATS_LIB_PATH="/tmp/bats-helpers" load "$BATS_LIB_PATH/bats-support/load.bash" load "$BATS_LIB_PATH/bats-assert/load.bash" load "$BATS_LIB_PATH/bats-file/load.bash"