Commit 38ef630d authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'ci/pipeline-rules' into 'main'

[CI] add workflow and rules for the existing jobs

See merge request !17
parents 83408d63 61bea4e2
Loading
Loading
Loading
Loading
Loading
+35 −0
Original line number Diff line number Diff line
@@ -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
@@ -70,6 +89,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
# ---------------------------------------------------------------
@@ -99,6 +126,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:
@@ -112,6 +145,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"
@@ -152,6 +186,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"