From 014e02ab075333bccd6ac5f3c8eaceba6ab41157 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Thu, 1 Oct 2020 08:58:29 -1000 Subject: [PATCH] CI: use PKG_SOURCE instead of PKG_NAME The PKG_NAME is the installable name of a package while PKG_SOURCE is the folder containig both `Makefile` and possibliy `test.sh` This approach previously worked for packages where both NAME and SOURCE are the same, e.g. `vim`, however fore more complex packages like `mariadb` (SOURCE) the NAMES are partly *mariadb-server-plugin-handlersocket*, which is no existing folder. With this commit the `PKG_SOURCE` is used to find the `test.sh` script. Signed-off-by: Paul Spooren --- .github/workflows/entrypoint.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/entrypoint.sh b/.github/workflows/entrypoint.sh index c85674d94b..7ec81c46d4 100755 --- a/.github/workflows/entrypoint.sh +++ b/.github/workflows/entrypoint.sh @@ -10,12 +10,15 @@ for PKG in /ci/*.ipk; do PKG_NAME=$(sed -ne 's#^Package: \(.*\)$#\1#p' ./control) # package version without release PKG_VERSION=$(sed -ne 's#^Version: \(.*\)-[0-9]*$#\1#p' ./control) + # package source contianing test.sh script + PKG_SOURCE=$(sed -ne 's#^Source: .*/\(.*\)$#\1#p' ./control) - echo "Testing package $PKG_NAME ($PKG_VERSION)" + echo "Testing package $PKG_NAME in version $PKG_VERSION from $PKG_SOURCE" opkg install "$PKG" - TEST_SCRIPT=$(find /ci/ -name "$PKG_NAME" -type d)/test.sh + TEST_SCRIPT=$(find /ci/ -name "$PKG_SOURCE" -type d)/test.sh + if [ -f "$TEST_SCRIPT" ]; then echo "Use package specific test.sh" if sh "$TEST_SCRIPT" "$PKG_NAME" "$PKG_VERSION"; then -- 2.30.2