Fix BATS helper library paths and update workflow

This commit is contained in:
Deploy Bot
2025-07-17 20:59:13 -04:00
parent 19d39793c0
commit a23b1d7a10
2 changed files with 13 additions and 13 deletions

View File

@@ -38,28 +38,28 @@ jobs:
sudo ./bats-core/install.sh /usr/local sudo ./bats-core/install.sh /usr/local
fi fi
# Install bats-support and bats-assert in a standard location # Install bats-support and bats-assert in a local directory
BATS_HELPER_PATH="/usr/local/lib/bats-helpers" BATS_HELPER_PATH="$GITHUB_WORKSPACE/bats-helpers"
sudo mkdir -p $BATS_HELPER_PATH mkdir -p "$BATS_HELPER_PATH"
# Clone and install bats-support # Clone bats-support
if [ ! -d "$BATS_HELPER_PATH/bats-support" ]; then if [ ! -d "$BATS_HELPER_PATH/bats-support" ]; then
git clone https://github.com/bats-core/bats-support.git /tmp/bats-support --depth 1 git clone https://github.com/bats-core/bats-support.git "$BATS_HELPER_PATH/bats-support" --depth 1
sudo mv /tmp/bats-support $BATS_HELPER_PATH/
fi fi
# Clone and install bats-assert # Clone bats-assert
if [ ! -d "$BATS_HELPER_PATH/bats-assert" ]; then if [ ! -d "$BATS_HELPER_PATH/bats-assert" ]; then
git clone https://github.com/bats-core/bats-assert.git /tmp/bats-assert --depth 1 git clone https://github.com/bats-core/bats-assert.git "$BATS_HELPER_PATH/bats-assert" --depth 1
sudo mv /tmp/bats-assert $BATS_HELPER_PATH/
fi fi
# Clone and install bats-file # Clone bats-file
if [ ! -d "$BATS_HELPER_PATH/bats-file" ]; then if [ ! -d "$BATS_HELPER_PATH/bats-file" ]; then
git clone https://github.com/bats-core/bats-file.git /tmp/bats-file --depth 1 git clone https://github.com/bats-core/bats-file.git "$BATS_HELPER_PATH/bats-file" --depth 1
sudo mv /tmp/bats-file $BATS_HELPER_PATH/
fi fi
# Export the path for use in tests
echo "BATS_LIB_PATH=$BATS_HELPER_PATH" >> $GITHUB_ENV
- name: Set up SSH - name: Set up SSH
run: | run: |
# Create .ssh directory # Create .ssh directory

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bats #!/usr/bin/env bats
# Load BATS helper libraries # 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-support/load.bash"
load "$BATS_LIB_PATH/bats-assert/load.bash" load "$BATS_LIB_PATH/bats-assert/load.bash"
load "$BATS_LIB_PATH/bats-file/load.bash" load "$BATS_LIB_PATH/bats-file/load.bash"