CI: Export few helpful variables for CI tests
authorMichal Hrusecky <michal.hrusecky@turris.com>
Sat, 3 Oct 2020 17:31:24 +0000 (19:31 +0200)
committerPaul Spooren <mail@aparcar.org>
Sat, 10 Oct 2020 21:16:13 +0000 (11:16 -1000)
Export PKG_NAME and PKG_VERSION to make test scripts better readable
and also export a path to the helper script providing colorful output.

Signed-off-by: Michal Hrusecky <michal.hrusecky@turris.com>
.github/workflows/entrypoint.sh

index 7ec81c46d45f92bbb7ee104cb46a426eb14d95ba..37fb373234707006dde7c9a9a26c66d8edf9716c 100755 (executable)
@@ -4,6 +4,8 @@ mkdir -p /var/lock/
 
 opkg update
 
+[ -n "$CI_HELPER" ] || CI_HELPER="/ci/.github/workflows/ci_helpers.sh"
+
 for PKG in /ci/*.ipk; do
        tar -xzOf "$PKG" ./control.tar.gz | tar xzf - ./control 
        # package name including variant
@@ -17,6 +19,8 @@ for PKG in /ci/*.ipk; do
 
        opkg install "$PKG"
 
+       export PKG_NAME PKG_VERSION CI_HELPER
+
        TEST_SCRIPT=$(find /ci/ -name "$PKG_SOURCE" -type d)/test.sh
 
        if [ -f "$TEST_SCRIPT" ]; then