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

add workflow and rules for the existing jobs

parent 336ea403
Loading
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
@@ -17,6 +17,23 @@ variables:
default:
  interruptible: true # Make all jobs by default interruptible

workflow:
  # 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 +86,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 +123,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 +142,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 +183,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"