From b6aaa4445e4040f08c88b8f682010d0defa2a8ae Mon Sep 17 00:00:00 2001 From: Jacques Xing Date: Tue, 17 Sep 2024 09:35:52 +0000 Subject: [PATCH] Update workflow rules --- .gitlab-ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 93e78b61..8fa224ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,20 @@ workflow: rules: + # Run pipeline on tags for the main project + - if: $CI_COMMIT_TAG && $CI_PROJECT_PATH == "xcompact3d/x3d2" # Run pipeline on the default branch for the main project - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PROJECT_PATH == "xcompact3d/x3d2" + - if: $CI_COMMIT_BRANCH == "main" && $CI_PROJECT_PATH == "xcompact3d/x3d2" # DO NOT run pipeline if Draft - - if: $CI_PIPELINE_SOURCE == "external_pull_request_event" && $CI_MERGE_REQUEST_TITLE =~ /^Draft:.*/ + - if: $CI_PIPELINE_SOURCE == "external_pull_request_event" && $CI_MERGE_REQUEST_TITLE =~ /^(\[Draft\]|\(Draft\)|Draft:).*/ when: never # Other merge requests trigger pipelines - if: $CI_PIPELINE_SOURCE == "external_pull_request_event" + changes: + compare_to: 'refs/heads/main' + paths: + - '**/src/*' + - '**/examples/*' + - '**/tests/*' stages: - build-and-test