Commit e8938793 authored by mcdonaldb's avatar mcdonaldb
Browse files

Merge branch 'main' into...

Merge branch 'main' into 1-ivas-internal-error-in-decoder-for-custom-loudspeaker-format-with-sba-input-at-24-4kbps
parents 29d9814e 9815baa2
Loading
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+171 −0
Original line number Diff line number Diff line
variables:
  TESTV_DIR: "/usr/local/testv"


# prevent running two pipelines on pushes to merge request branches
workflow:
  rules:
    # see https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines
    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
      when: never
    - when: always


stages:
  - maintenance
  - build
  - test
  - compare


# template for all test jobs
.test-job:
  rules:
    - if: $MIRROR_ACCESS_TOKEN # Don't run in the mirror update pipeline (only then MIRROR_ACCESS_TOKEN is defined)
      when: never
    - when: on_success

# template test job on linux
.test-job-linux:
  extends: .test-job
  tags:
    - ivas-linux

# template for test jobs on linux that need the TESTV_DIR
.test-job-linux-needs-testv-dir:
  extends: .test-job-linux
  before_script:
    - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi
    - cp -r scripts/testv/* $TESTV_DIR/
  

# build all components of the project, i.e. codec itself, the unittests, the prerenderer and the standalone version of the TD object renderer
build-all-linux-make:
  extends: .test-job-linux
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  stage: build
  script:
    - bash ci/build_all_linux.sh

build-codec-linux-cmake:
  extends: .test-job-linux
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  stage: build
  script:
    - mkdir build
    - cd build
    - cmake ..
    - make -j

build-codec-instrumented-linux:
  extends: .test-job-linux
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  stage: build
  script:
    - bash ci/build_codec_instrumented_linux.sh

# make sure that the codec builds with msan, asan and usan
build-codec-sanitizers-linux:
  extends: .test-job-linux
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  stage: build
  script:
    - bash ci/build_codec_sanitizers_linux.sh


# test that runs all modes with 1s input signals
codec-smoke-test:
  extends: .test-job-linux-needs-testv-dir
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  stage: test
  script:
    - bash ci/smoke_test.sh
  artifacts:
    paths:
      - out/logs


# compare bit exactness between target and source branch
self-test-on-merge-request:
  extends: .test-job-linux
  stage: compare
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  script:
    ### build test binaries, initial clean for paranoia reasons
    - make clean
    - mkdir build
    - cd build
    - cmake ..
    - make -j
    - mv IVAS_cod ../IVAS_cod_test
    - mv IVAS_dec ../IVAS_dec_test
    - cd ..
    - rm -rf build/*

    ### store the current commit hash
    - source_branch_commit_sha=$(git rev-parse HEAD)

    ### checkout version to compare against
    # first delete local target branch to avoid conflicts when branch is cached and there are merge conflicts during fetching
    # depending on chaching, the branch may not be there, so prevent failure of this command -> should maybe be done smarter later
    - git branch -D $CI_MERGE_REQUEST_TARGET_BRANCH_NAME || true
    # needed when depth is lower than the number of commits in the branch
    - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME:$CI_MERGE_REQUEST_TARGET_BRANCH_NAME

    ### compare to last target branch commit before pipeline was created
    - target_commit=$(git log $CI_MERGE_REQUEST_TARGET_BRANCH_NAME -1 --oneline --before=${CI_PIPELINE_CREATED_AT} --format=%H)
    - git checkout $target_commit

    ### build reference binaries
    - cd build
    - cmake ..
    - make -j
    - mv IVAS_cod ../IVAS_cod_ref
    - mv IVAS_dec ../IVAS_dec_ref
    - cd ..

    ### re-checkout the commit from the source branch to have up-to-date self_test.py and scripts/testv (and actually everything)
    - git checkout $source_branch_commit_sha

    ### run selftest
    - ls -altr scripts/testv
    - python3 ./scripts/self_test.py --encref IVAS_cod_ref --decref IVAS_dec_ref --enctest IVAS_cod_test --dectest IVAS_dec_test | tee test_output.txt

    ### analyse test output
    # check for crashes during the test, if any happened, fail the test
    - if cat test_output.txt | grep -c "Run errors were encountered for the following conditions:"; then echo "Codec had run errors"; exit 1; fi
    # check for non bitexact output and fail test if the merge request does not have a non-BE tag
    - if ! cat test_output.txt | grep -c "All [0-9]* tests are bitexact" && ! echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[non[ -]*be\]"; then echo "Non-bitexact cases without non-BE tag encountered"; exit 1; fi
  artifacts:
    paths:
      - test_output.txt
      - scripts/test/logs
      - scripts/ref/logs


# Pull state of a branch on 3GPP repo, push to a mirror repo.
pull-from-3gpp-forge:
  stage: maintenance
  rules:
    - if: $MIRROR_ACCESS_TOKEN # Only run in the mirror update pipeline (only then MIRROR_ACCESS_TOKEN is defined)
  script:
    # Set up git LFS for mirroring (see: https://github.com/git-lfs/git-lfs/issues/1762)
    - git lfs install --skip-smudge --local
    
    # Check out mirror branch - by default the runner checks out by commit hash, which results in detached head state
    - git checkout $CI_COMMIT_BRANCH
    
    # Pull commits from upstream
    - git remote add upstream https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec.git
    - git pull --ff-only --tags upstream $MIRROR_SOURCE_BRANCH
    - git lfs pull upstream

    # Push to mirror, include tags. Option `-o ci.skip` tells GitLab to skip CI for the pushed commits (assumed already tested upstream)
    - git push --tags -o ci.skip "https://${GITLAB_USER_LOGIN}:${MIRROR_ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:${CI_COMMIT_BRANCH}"
+0 −1
Original line number Diff line number Diff line
@@ -148,7 +148,6 @@ DEPS = $(addprefix $(OBJDIR)/,$(SRCS_LIBCOM:.c=.P) $(SRCS_LIBDEBUG:.c=.P) $(SRCS
###############################################################################

.PHONY: all clean clean_unittests clean_all
.NOTPARALLEL: clean clean_unittests clean_all

all: $(CLI_APIENC) $(CLI_APIDEC)

ci/build_all_linux.sh

0 → 100755
+16 −0
Original line number Diff line number Diff line
#! /usr/bin/bash

if [ ! -d "lib_com" ]; then
    echo "not in root directory! - please run in IVAS root"
    exit 1
fi

# first build codec, everything else needs this anyway
make clean all -j
# build unittests
make unittests -j
# build prerenderer
make -C scripts/prerenderer -j
# build standalone TD object renderer
make -C scripts/td_object_renderer/object_renderer_standalone -j
+11 −0
Original line number Diff line number Diff line
#! /usr/bin/bash

if [ ! -d "lib_com" ]; then
    echo "not in root directory! - please run in IVAS root"
    exit 1
fi

cd scripts
./prepare_instrumentation.sh
cd c-code_instrument
make -j
+15 −0
Original line number Diff line number Diff line
#! /usr/bin/bash

if [ ! -d "lib_com" ]; then
    echo "not in root directory! - please run in IVAS root"
    exit 1
fi

# CI linux container would do this, can stay commented if clang (v13) is in your path
#PATH=$PATH:/usr/lib/llvm-13/bin
make clean
make CLANG=1 -j
make clean
make CLANG=2 -j
make clean
make CLANG=3 -j
Loading