Commit fd00b798 authored by Fabian Müller's avatar Fabian Müller
Browse files

Port job templates and rules from ivas-codec-pc

parent 1dab09fd
Loading
Loading
Loading
Loading
+91 −0
Original line number Diff line number Diff line
# When designing templates, try not to use too much inheritance and
# if multiple templates and extended on, remember that on conflict,
# latest overwrites the parameter.

.job-linux:
  tags:
    - ivas-linux

.job-windows:
  tags:
    - ivas-windows

.build-job-linux:
  stage: build
  extends:
    - .job-linux
  timeout: "4 minutes"
  needs: []
  before_script:
    - |
      if [[ "$IVAS_CODEC_CI_REF" == "" ]]; then echo "Error: IVAS_CODEC_CI_REF not set" && exit 1; fi
    - git clone "$CI_SERVER_URL"/ivas-codec-pc/ivas-codec-ci.git --depth 1 --branch "$IVAS_CODEC_CI_REF"

.build-job-windows:
  stage: build
  extends:
    - .job-windows
  needs: []
  timeout: "4 minutes"
  before_script:
    - if (-not $env:IVAS_CODEC_CI_REF) { echo "Error: IVAS_CODEC_CI_REF not set" ; exit 1 }
    - git clone $env:CI_SERVER_URL/ivas-codec-pc/ivas-codec-ci.git --depth 1 --branch $env:IVAS_CODEC_CI_REF

# nothing to see here, basically an alias
.test-job-linux:
  extends:
    - .job-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
    - python3 scripts/prepare_combined_format_inputs.py
    - cp -r scripts/testv/* $TESTV_DIR/

.sanitizer-selftest-on-mr:
  stage: test
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    expire_in: 1 week
    when: always
    paths:
      - report-junit-20ms.xml
      - report-junit-10ms.xml
      - report-junit-5ms.xml
      - report-20ms.html
      - report-10ms.html
      - report-5ms.html
    expose_as: "Sanitizer selftest results"
    reports:
      junit:
        - report-junit-20ms.xml
        - report-junit-10ms.xml
        - report-junit-5ms.xml

.sanitizer-selftest-ltv:
  stage: test
  extends:
    - .test-job-linux-needs-testv-dir
  artifacts:
    name: "$CI_JOB_NAME--sha-$CI_COMMIT_SHORT_SHA--results"
    expire_in: 2 week
    when: always
    paths:
      - report-junit-20ms.xml
      - report-junit-10ms.xml
      - report-junit-5ms.xml
      - report-20ms.html
      - report-10ms.html
      - report-5ms.html
    expose_as: "Sanitizer selftest results"
    reports:
      junit:
        - report-junit-20ms.xml
        - report-junit-10ms.xml
        - report-junit-5ms.xml

includes/rules.yml

0 → 100644
+39 −0
Original line number Diff line number Diff line
# templates for rules
.rules-basis:
  rules:
    - if: $MIRROR_ACCESS_TOKEN # Don't run in the mirror update pipeline (only then MIRROR_ACCESS_TOKEN is defined)
      when: never
    - if: $CI_PIPELINE_SOURCE == 'schedule' # Don't run in any scheduled pipelines by default (use schedule templates below to enable again for certain conditions)
      when: never
    - if: $CI_PIPELINE_SOURCE == 'trigger' # Don't run triggered pipeline by default
      when: never
    - if: $MANUAL_PIPELINE_TYPE == 'test-be-release' # Skip all the normal jobs when testing manually against release codec
      when: never
    - if: $MANUAL_PIPELINE_TYPE == 'test-long-self-test' # Skip all the normal jobs when testing manually against release codec
      when: never
    - if: $MANUAL_PIPELINE_TYPE == 'ivas-conformance'
      when: never
    - if: $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux'
      when: never
    - if: $MANUAL_PIPELINE_TYPE == 'check-clipping'
      when: never
    - if: $MANUAL_PIPELINE_TYPE == 'test-branch-vs-input-passthrough'
      when: never
    - when: on_success

.rules-merge-request:
  extends: .rules-basis
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never

.rules-main-push:
  extends: .rules-basis
  rules:
    - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

.rules-main-scheduled:
  extends: .rules-basis
  rules:
    - if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+2 −0
Original line number Diff line number Diff line
include:
  # variables can be overwritten easily if needed
  - local: includes/default-variables.yml
  - local: includes/rules.yml
  - local: includes/job-templates.yml

default:
  # by default, we want all jobs to be interruptible, and we need to configure this explicitly