Commit 62857c15 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'feat/adaptive-pipeline' into 'master'

Adaptive pipeline

See merge request to-be-continuous/golang!28
parents 60058900 65c6cdd7
Loading
Loading
Loading
Loading
+26 −9
Original line number Diff line number Diff line
@@ -13,14 +13,33 @@
# program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
# Floor, Boston, MA  02110-1301, USA.
# =========================================================================================
# default workflow rules
# default workflow rules: Merge Request pipelines
workflow:
  rules:
    # exclude merge requests
    - if: $CI_MERGE_REQUEST_ID
    # prevent branch pipeline when an MR is open (prefer MR pipeline)
    - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
      when: never
    - when: always

# test job prototype: implement adaptive pipeline rules
.test-policy:
  rules:
    # on tag: auto & failing
    - if: $CI_COMMIT_TAG
    # on ADAPTIVE_PIPELINE_DISABLED: auto & failing
    - if: '$ADAPTIVE_PIPELINE_DISABLED == "true"'
    # on production or integration branch(es): auto & failing
    - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF || $CI_COMMIT_REF_NAME =~ $INTEG_REF'
    # early stage (dev branch, no MR): manual & non-failing
    - if: '$CI_MERGE_REQUEST_ID == null && $CI_OPEN_MERGE_REQUESTS == null'
      when: manual
      allow_failure: true
    # Draft MR: auto & non-failing
    - if: '$CI_MERGE_REQUEST_TITLE =~ /^Draft:.*/'
      allow_failure: true
    # else (Ready MR): auto & failing
    - when: on_success

variables:
  # variabilized tracking image
  TBC_TRACKING_IMAGE: "$CI_REGISTRY/to-be-continuous/tools/tracking:master"
@@ -322,7 +341,9 @@ go-test:
      - $GO_PROJECT_DIR/reports/
  rules:
    # if $GO_TEST_IMAGE set
    - if: '$GO_TEST_IMAGE'
    - if: '$GO_TEST_IMAGE == null'
      when: never
    - !reference [.test-policy, rules]

go-build-test:
  extends: .go-base
@@ -362,11 +383,7 @@ go-ci-lint:
    # exclude if GO_CI_LINT_DISABLED set
    - if: '$GO_CI_LINT_DISABLED == "true"'
      when: never
    # on production or integration branches: auto
    - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF || $CI_COMMIT_REF_NAME =~ $INTEG_REF'
    # else (development branches): non-blocking
    - if: $CI_COMMIT_REF_NAME # useless but prevents GitLab from warning
      allow_failure: true
    - !reference [.test-policy, rules]

go-mod-outdated:
  extends: .go-base