Skip to content

Commit

Permalink
tentative fix + matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
brokenpip3 committed Apr 3, 2024
1 parent 43e20f8 commit 837e22e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test-local-action-inside-home.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:

jobs:
local_test_home:
strategy:
fail-fast: false
matrix:
version: ["1.9.0", "1.10.0", "1.11.0"]
runs-on: ubuntu-latest
env:
BATS_LIB_PATH: "${{ github.workspace }}/tests"
Expand All @@ -22,6 +26,7 @@ jobs:
id: bats-action
uses: ./
with:
bats-version: ${{ matrix.version }}
support-clean: "false"
support-path: "${{ github.workspace }}/tests/bats-support"
assert-clean: "false"
Expand Down
18 changes: 14 additions & 4 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,20 @@ runs:
# Archlinux style, except that we are not in a fakeroot env
# https://gitlab.archlinux.org/archlinux/packaging/packages/bash-bats/-/blob/main/PKGBUILD
sed -i 's|BATS_ROOT/libexec/bats-core/bats|BATS_ROOT/share/bats/bats|g' bin/bats lib/bats-core/*
sed -i 's|BATS_BASE_LIBDIR=lib|BATS_BASE_LIBDIR=share|g' bin/bats
sed -i 's|BATS_LIBDIR/bats-core/|BATS_LIBDIR/bats/|g' libexec/bats-core/*
sed -i 's|BATS_LIBDIR/bats-core/|BATS_LIBDIR/bats/|g' lib/bats-core/*
# TODO: find a better way to understand if the version of bats is =< 1.10
# without installing semver binaries.
# TODO: we may consider to use the upstream install.sh script now
if [ -f libexec/bats-core/bats-gather-tests ]; then
set -i 's|BATS_BASE_LIBDIR=lib|BATS_BASE_LIBDIR=share|g' bin/bats
sed -i 's|BATS_ROOT/libexec/bats-core/bats|BATS_ROOT/share/bats/bats|g' bin/bats
sed -i 's|BATS_ROOT/$BATS_LIBDIR/bats-core/|BATS_ROOT/$BATS_LIBDIR/bats/|g' libexec/bats-core/*
sed -i 's|BATS_ROOT/$BATS_LIBDIR/bats-core/|BATS_ROOT/$BATS_LIBDIR/bats/|g' lib/bats-core/*
else
sed -i 's|BATS_ROOT/libexec/bats-core/bats|BATS_ROOT/share/bats/bats|g' bin/bats
sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' libexec/bats-core/*
sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' lib/bats-core/*
fi
for fn in libexec/bats-core/*; do
install -Dm755 ${fn} \
Expand Down

0 comments on commit 837e22e

Please sign in to comment.