diff --git a/main-basop.yml b/main-basop.yml index fda6a3fae70f41d66d8d642dec2868c1c0765c8c..efc81bc57cb8ddbf5bbc8c53dff985ea4617e180 100644 --- a/main-basop.yml +++ b/main-basop.yml @@ -285,7 +285,8 @@ workflow: - if [ "$DELTA_ODG" = "true" ]; then comp_args="${comp_args} --odg_bin"; MEASURES_FOR_REPORT="$MEASURES_FOR_REPORT DELTA_ODG"; fi - if [ "$SPLIT_COMPARISON" = "true" ]; then comp_args="${comp_args} --split-comparison"; fi - - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-and-create-float-ref-outputs.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-codec.sh ivas-float-update _ref + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-codec.sh HEAD # DMX comparison only in manual job with no other metrics - if [ "$COMPARE_DMX" = "true" ]; then diff --git a/snippets/basop/build-codec.sh b/snippets/basop/build-codec.sh new file mode 100644 index 0000000000000000000000000000000000000000..baf4ae196bcd1b58cf42ce9f8f80fbb3dde883e1 --- /dev/null +++ b/snippets/basop/build-codec.sh @@ -0,0 +1,51 @@ +#! /bin/bash + +# Usage: build-codec.sh [] +# +# Checks out , builds executables, optionally appends and returns to current branch + +set -euxo pipefail + +cd "${CI_PROJECT_DIR}" + +commit=$1 +if [ $# -eq 2 ]; then + suffix=$2 + suffix_msg="suffix $2" +else + suffix="" + suffix_msg="no suffix" +fi + +echo "Building binaries from commit $commit with $suffix_msg" + +current_commit_sha="$(git rev-parse HEAD)" + +restore_stash() { + if [[ "$(git stash list)" != "" ]]; then + git stash pop + fi +} +trap restore_stash EXIT + +# store potential changes +# should never fail, even if there is nothing to be stored +git stash + +git checkout "$commit" + +bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/activate-debug-mode-info-if-set.sh + +make clean +make -j "$(nproc)" + +# avoid errors in mv when renaming to same file +if [ -n "$suffix" ]; then + mv IVAS_cod IVAS_cod"$suffix" + mv IVAS_dec IVAS_dec"$suffix" + mv IVAS_rend IVAS_rend"$suffix" + if [ -f ISAR_post_rend ]; then mv ISAR_post_rend ISAR_post_rend"$suffix"; fi +fi +# return to current branch +git restore . +git checkout "$current_commit_sha"