From 663facd151f108f8c7cac2e58d7ef5bffcc9af94 Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Mon, 3 Jul 2023 12:21:44 +0100 Subject: [PATCH] ci: remove unnecessary cleanup on exit after error Signed-off-by: Tiago Castro --- scripts/cargo-test.sh | 9 +++++---- scripts/grpc-test.sh | 12 +++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/cargo-test.sh b/scripts/cargo-test.sh index cf33aef933..cdfbd4b8c3 100755 --- a/scripts/cargo-test.sh +++ b/scripts/cargo-test.sh @@ -1,18 +1,19 @@ #!/usr/bin/env bash -SCRIPTDIR=$(dirname "$0") +SCRIPTDIR="$(realpath "$(dirname "$0")")" cleanup_handler() { - $SCRIPTDIR/clean-cargo-tests.sh || true + ERROR=$? + "$SCRIPTDIR"/clean-cargo-tests.sh || true + if [ $ERROR != 0 ]; then exit $ERROR; fi } -trap cleanup_handler ERR INT QUIT TERM HUP EXIT - echo "running cargo-test..." echo "rustc version:" rustc --version cleanup_handler +trap cleanup_handler INT QUIT TERM HUP EXIT set -euxo pipefail export PATH=$PATH:${HOME}/.cargo/bin diff --git a/scripts/grpc-test.sh b/scripts/grpc-test.sh index a865e90314..1f07c10137 100755 --- a/scripts/grpc-test.sh +++ b/scripts/grpc-test.sh @@ -1,19 +1,21 @@ #!/usr/bin/env bash -SCRIPTDIR=$(dirname "$0") -trap cleanup_handler ERR INT QUIT TERM HUP EXIT +SCRIPTDIR="$(realpath "$(dirname "$0")")" cleanup_handler() { - $SCRIPTDIR/clean-cargo-tests.sh || true + ERROR=$? + "$SCRIPTDIR"/clean-cargo-tests.sh || true + if [ $ERROR != 0 ]; then exit $ERROR; fi } +cleanup_handler +trap cleanup_handler INT QUIT TERM HUP EXIT + set -euxo pipefail export PATH="$PATH:${HOME}/.cargo/bin" export npm_config_jobs=$(nproc) -cleanup_handler - cargo build --all cd "$(dirname "$0")/../test/grpc" npm install --legacy-peer-deps