Browse Source

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 <mail@aparcar.org>
lilik-openwrt-22.03
Paul Spooren 4 years ago
parent
commit
014e02ab07
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      .github/workflows/entrypoint.sh

+ 5
- 2
.github/workflows/entrypoint.sh View File

@ -10,12 +10,15 @@ for PKG in /ci/*.ipk; do
PKG_NAME=$(sed -ne 's#^Package: \(.*\)$#\1#p' ./control) PKG_NAME=$(sed -ne 's#^Package: \(.*\)$#\1#p' ./control)
# package version without release # package version without release
PKG_VERSION=$(sed -ne 's#^Version: \(.*\)-[0-9]*$#\1#p' ./control) 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" 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 if [ -f "$TEST_SCRIPT" ]; then
echo "Use package specific test.sh" echo "Use package specific test.sh"
if sh "$TEST_SCRIPT" "$PKG_NAME" "$PKG_VERSION"; then if sh "$TEST_SCRIPT" "$PKG_NAME" "$PKG_VERSION"; then


Loading…
Cancel
Save