Skip to content

Commit 837e22e

Browse files
committed
tentative fix + matrix
1 parent 43e20f8 commit 837e22e

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

.github/workflows/test-local-action-inside-home.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010

1111
jobs:
1212
local_test_home:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
version: ["1.9.0", "1.10.0", "1.11.0"]
1317
runs-on: ubuntu-latest
1418
env:
1519
BATS_LIB_PATH: "${{ github.workspace }}/tests"
@@ -22,6 +26,7 @@ jobs:
2226
id: bats-action
2327
uses: ./
2428
with:
29+
bats-version: ${{ matrix.version }}
2530
support-clean: "false"
2631
support-path: "${{ github.workspace }}/tests/bats-support"
2732
assert-clean: "false"

action.yaml

+14-4
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,20 @@ runs:
145145
146146
# Archlinux style, except that we are not in a fakeroot env
147147
# https://gitlab.archlinux.org/archlinux/packaging/packages/bash-bats/-/blob/main/PKGBUILD
148-
sed -i 's|BATS_ROOT/libexec/bats-core/bats|BATS_ROOT/share/bats/bats|g' bin/bats lib/bats-core/*
149-
sed -i 's|BATS_BASE_LIBDIR=lib|BATS_BASE_LIBDIR=share|g' bin/bats
150-
sed -i 's|BATS_LIBDIR/bats-core/|BATS_LIBDIR/bats/|g' libexec/bats-core/*
151-
sed -i 's|BATS_LIBDIR/bats-core/|BATS_LIBDIR/bats/|g' lib/bats-core/*
148+
149+
# TODO: find a better way to understand if the version of bats is =< 1.10
150+
# without installing semver binaries.
151+
# TODO: we may consider to use the upstream install.sh script now
152+
if [ -f libexec/bats-core/bats-gather-tests ]; then
153+
set -i 's|BATS_BASE_LIBDIR=lib|BATS_BASE_LIBDIR=share|g' bin/bats
154+
sed -i 's|BATS_ROOT/libexec/bats-core/bats|BATS_ROOT/share/bats/bats|g' bin/bats
155+
sed -i 's|BATS_ROOT/$BATS_LIBDIR/bats-core/|BATS_ROOT/$BATS_LIBDIR/bats/|g' libexec/bats-core/*
156+
sed -i 's|BATS_ROOT/$BATS_LIBDIR/bats-core/|BATS_ROOT/$BATS_LIBDIR/bats/|g' lib/bats-core/*
157+
else
158+
sed -i 's|BATS_ROOT/libexec/bats-core/bats|BATS_ROOT/share/bats/bats|g' bin/bats
159+
sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' libexec/bats-core/*
160+
sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' lib/bats-core/*
161+
fi
152162
153163
for fn in libexec/bats-core/*; do
154164
install -Dm755 ${fn} \

0 commit comments

Comments
 (0)