From e983162ec892511e221e5404b00df0f50533cda0 Mon Sep 17 00:00:00 2001 From: Chen Yudong Date: Mon, 13 Nov 2023 22:57:20 +0800 Subject: [PATCH] ci: add qa-test-tag rules --- tools/ci/config/deploy.yml | 4 ++-- tools/ci/config/rules.yml | 32 +++++++++++++++++++------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/tools/ci/config/deploy.yml b/tools/ci/config/deploy.yml index 0523eccbd0..57ae900a43 100644 --- a/tools/ci/config/deploy.yml +++ b/tools/ci/config/deploy.yml @@ -44,7 +44,7 @@ push_to_github: extends: - .deploy_job_template - .before_script_lesser - - .rules:protected-no_label + - .rules:push_to_github dependencies: [] script: - add_github_ssh_keys @@ -92,7 +92,7 @@ deploy_docs_production: # The DOCS_PROD_* variables used by this job are "Protected" so these branches must all be marked "Protected" in Gitlab settings extends: - .deploy_docs_template - - .rules:protected-no_label + - .rules:push_to_github stage: post_deploy needs: # ensure runs after push_to_github succeeded - build_docs_html diff --git a/tools/ci/config/rules.yml b/tools/ci/config/rules.yml index 5d83ecce0b..25f3ea6000 100644 --- a/tools/ci/config/rules.yml +++ b/tools/ci/config/rules.yml @@ -39,23 +39,26 @@ .if-ref-master: &if-ref-master if: '$CI_COMMIT_REF_NAME == "master"' +.if-qa-test-tag: &if-qa-test-tag + if: '$CI_COMMIT_TAG =~ /^qa-test/' + .if-tag-release-no_label: &if-tag-release-no_label if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/ && $BOT_TRIGGER_WITH_LABEL == null' .if-protected: &if-protected - if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/)' + if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) || $CI_COMMIT_TAG =~ /^qa-test/' .if-protected-no_label: &if-protected-no_label if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null' .if-dev-push: &if-dev-push - if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")' + if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")' .if-schedule: &if-schedule if: '$CI_PIPELINE_SOURCE == "schedule"' .if-trigger: &if-trigger - if: '$CI_PIPELINE_SOURCE == "trigger"' + if: '$BOT_TRIGGER_WITH_LABEL || $CI_PIPELINE_SOURCE == "trigger"' .if-label-regular_test: &if-label-regular_test if: '$BOT_LABEL_REGULAR_TEST' @@ -120,6 +123,12 @@ rules: - <<: *if-protected-no_label +.rules:push_to_github: + rules: + - <<: *if-qa-test-tag + when: never + - <<: *if-protected-no_label + .rules:protected-schedule: rules: - <<: *if-protected @@ -143,16 +152,6 @@ rules: - <<: *if-tag-release-no_label -.rules:ref:master-schedule: - rules: - - <<: *if-ref-master - - <<: *if-schedule - -.rules:ref:master-always: - rules: - - <<: *if-ref-master - when: always - .rules:labels:static_analysis-only: rules: - <<: *if-label-static_analysis @@ -165,6 +164,8 @@ .rules:labels:build_docs: rules: + - <<: *if-qa-test-tag + when: never - <<: *if-protected-no_label - <<: *if-label-build - <<: *if-label-regular_test @@ -172,11 +173,15 @@ .rules:labels:build_docs-slim: rules: + - <<: *if-qa-test-tag + when: never - <<: *if-protected-no_label - <<: *if-label-build_docs .rules:labels:build_docs-preview: rules: + - <<: *if-qa-test-tag + when: never - <<: *if-label-build_docs .rules:labels:weekend_test-only: @@ -243,6 +248,7 @@ - <<: *if-label-regular_test - <<: *if-label-example_test - <<: *if-label-custom_test + - <<: *if-label-unit_test-all_labels - <<: *if-label-weekend_test .rules:build_tests:weekend_test: