diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4bc603618bf515d4d602d2ae16b320d38f2e6043..cc1cf77504afc2a1ed57f47579300019021f5f53 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,6 +17,25 @@ variables: default: interruptible: true # Make all jobs by default interruptible +workflow: + name: '$IVAS_PIPELINE_NAME' + 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 + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + variables: + IVAS_PIPELINE_NAME: 'MR pipeline: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME' + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Pushes to main + variables: + IVAS_PIPELINE_NAME: 'Push pipeline: $CI_COMMIT_BRANCH' + - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'default' # for testing + variables: + IVAS_PIPELINE_NAME: 'Web run pipeline: $CI_COMMIT_BRANCH' + - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'pytest-mld' + variables: + IVAS_PIPELINE_NAME: 'Run MLD tool against float ref: $CI_COMMIT_BRANCH' + stages: - build - test @@ -69,6 +88,14 @@ stages: .remove-unsupported-testcases: &remove-unsupported-testcases - sed -i '1629,1635d' scripts/config/self_test.prm +.rules-pytest-mld: + rules: + - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == "pytest-mld" + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + - 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 + # --------------------------------------------------------------- # Job templates # --------------------------------------------------------------- @@ -98,6 +125,12 @@ stages: # ensure that codec builds on linux build-codec-linux-make: + rules: + - if: $CI_PIPELINE_SOURCE == 'web' + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + - 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 extends: - .build-job-linux script: @@ -111,6 +144,7 @@ build-codec-linux-make: ivas-pytest-mld-enc-dec: extends: - .test-job-linux + - .rules-pytest-mld stage: test needs: ["build-codec-linux-make"] timeout: "30 minutes" @@ -151,6 +185,7 @@ ivas-pytest-mld-enc-dec: ivas-pytest-mld-dec: extends: - .test-job-linux + - .rules-pytest-mld stage: test needs: ["build-codec-linux-make"] timeout: "30 minutes"