Commit b0acccad authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'kiene/basop-ci-merge' into 'main'

Necessary changes for BASOP merge back to main branches

See merge request !11
parents a31272de fb3e3656
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
please refer to the [Wiki](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/home)
# IVAS codec CI

Home of CI configs and scripts for:

- [IVAS](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec)
- [IVAS BASOP](https://forge.3gpp.org/rep/sa4/audio/ivas-basop)

Refer to the  [IVAS Wiki](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/home) for more info on the CI setup.
This repository is mainly meant to share scripts and configs between the two repositories and (for BASOP) between differently configured branches.

## Notes about usage of the snippets

- in general prefer adding scripts here over using yaml anchors in a CI config file
- if your script shall modify some environment variable, you need to run it with `source` instead of calling it.
+3 −3
Original line number Diff line number Diff line
@@ -7,9 +7,9 @@
    - ivas-linux
  before_script:
    - |
      if [[ "$IVAS_CODEC_CI_REF" == "" ]]; then echo "Error: IVAS_CODEC_CI_REF not set" && exit 1; fi
      if [[ "$IVAS_CODEC_CI_REF" == "" ]]; then echo "Error: IVAS_CODEC_CI_REF not set" && exit 1; else echo "IVAS_CODEC_CI_REF set to: $IVAS_CODEC_CI_REF"; fi
    # note: git clone -b does not work with SHA refs, hence using the safe way of a full clone and git switch
    - git clone "$CI_SERVER_URL"/ivas-codec-pc/ivas-codec-ci.git && pushd ivas-codec-ci && git switch --detach "$IVAS_CODEC_CI_REF" && popd
    - git clone "$CI_SERVER_URL"/ivas-codec-pc/ivas-codec-ci.git ivas-codec-ci && pushd ivas-codec-ci && git checkout "$IVAS_CODEC_CI_REF" && popd

.job-windows:
  tags:
@@ -19,7 +19,7 @@
      if (-not $env:IVAS_CODEC_CI_REF) { echo "Error: IVAS_CODEC_CI_REF not set" ; exit 1 }
    # note: git clone -b does not work with SHA refs, hence using the safe way of a full clone and git switch
    # also, we cannot use && with powershell < 7 unfortunately, hence we cannot reliably detect if the snippet fails
    - git clone $env:CI_SERVER_URL/ivas-codec-pc/ivas-codec-ci.git; pushd ivas-codec-ci ; git switch --detach $env:IVAS_CODEC_CI_REF ; popd
    - git clone $env:CI_SERVER_URL/ivas-codec-pc/ivas-codec-ci.git ivas-codec-ci; pushd ivas-codec-ci ; git switch --detach $env:IVAS_CODEC_CI_REF ; popd

.build-job-linux:
  stage: build

main-basop.yml

0 → 100644
+2955 −0

File added.

Preview size limit exceeded, changes collapsed.

+44 −22
Original line number Diff line number Diff line
@@ -11,23 +11,41 @@ case "$mode" in
  branch_to_check_out="$FLOAT_REF_BRANCH"
  ivas_cod_filename="./$REF_ENCODER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  ivas_dec_filename="./$REF_DECODER_PATH_FOR_BUILD_DO_NOT_MODIFY"
        ivas_rend_filename="./IVAS_rend_ref"
  ivas_rend_filename="./$REF_RENDERER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  isar_post_rend_filename="./$REF_POST_RENDERER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  commit_file="$FLOAT_REF_COMMIT_FILE"
  ;;
float-ref-merge-source)
  branch_to_check_out="$FLOAT_REF_BRANCH_MERGE_SOURCE"
  ivas_cod_filename="./$MERGE_SOURCE_FLOAT_REF_ENCODER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  ivas_dec_filename="./$MERGE_SOURCE_FLOAT_REF_DECODER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  ivas_rend_filename="./$MERGE_SOURCE_FLOAT_REF_RENDERER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  isar_post_rend_filename="./$MERGE_SOURCE_FLOAT_REF_POST_RENDERER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  commit_file="$MERGE_SOURCE_FLOAT_REF_COMMIT_FILE"
  ;;
merge-target)
  branch_to_check_out="$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
  ivas_cod_filename="./$MERGE_TARGET_ENCODER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  ivas_dec_filename="./$MERGE_TARGET_DECODER_PATH_FOR_BUILD_DO_NOT_MODIFY"
        ivas_rend_filename="./IVAS_rend_merge_target"
  ivas_rend_filename="./$MERGE_TARGET_RENDERER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  isar_post_rend_filename="./$MERGE_TARGET_POST_RENDERER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  commit_file="$MERGE_TARGET_COMMIT_FILE"
  ;;
merge-source)
  branch_to_check_out="$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
  ivas_cod_filename="./$DUT_ENCODER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  ivas_dec_filename="./$DUT_DECODER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  ivas_rend_filename="./$DUT_RENDERER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  isar_post_rend_filename="./$DUT_POST_RENDERER_PATH_FOR_BUILD_DO_NOT_MODIFY"
  commit_file="$CUT_COMMIT_FILE"
  ;;
*)
  echo "Error: invalid mode: $mode"
  exit 2
  ;;
esac

echo "Building $mode binaries"
echo "Building $mode binaries from branch $branch_to_check_out"

# TODO: could probably always be run
if [[ "$mode" == "float-ref" ]]; then
@@ -47,16 +65,20 @@ trap restore_stash EXIT
# should never fail, even if there is nothing to be stored
git stash

if [[ "$mode" != "merge-source" ]]; then
  git checkout "$branch_to_check_out"
fi

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
mv IVAS_cod "$ivas_cod_filename"
mv IVAS_dec "$ivas_dec_filename"
mv IVAS_rend "$ivas_rend_filename"
if [ -f ISAR_post_rend ]; then mv ISAR_post_rend "$isar_post_rend_filename"; fi

# return to current branch
git restore .
+20 −0
Original line number Diff line number Diff line
#! /bin/bash

set -euxo pipefail

cd "${CI_PROJECT_DIR}"

if [ -f $MERGE_TARGET_COMMIT_FILE ]; then
  MERGE_REQUEST_TARGET="$(cat "$MERGE_TARGET_COMMIT_FILE")"
else
  echo "MERGE_TARGET_COMMIT_FILE ($MERGE_TARGET_COMMIT_FILE) does not exist, exiting!"
  exit 1
fi

# overwrite CI variable temporarily so we can use the other script
CI_MERGE_REQUEST_TARGET_BRANCH_NAME_tmp=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
export CI_MERGE_REQUEST_TARGET_BRANCH_NAME=$MERGE_REQUEST_TARGET

bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh merge-target

export CI_MERGE_REQUEST_TARGET_BRANCH_NAME=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME_tmp
Loading