0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 03:31:50 +02:00

ci: fixed support for child pipelines

This commit is contained in:
2024-05-07 12:48:24 +02:00
parent 20d6352351
commit e65c7f3be8

View File

@ -7,6 +7,7 @@ variables:
DOCKER_TLS_CERTDIR: "" DOCKER_TLS_CERTDIR: ""
BEC_CORE_BRANCH: "main" BEC_CORE_BRANCH: "main"
OPHYD_DEVICES_BRANCH: "main" OPHYD_DEVICES_BRANCH: "main"
CHILD_PIPELINE_BRANCH: "main"
workflow: workflow:
rules: rules:
@ -31,6 +32,11 @@ stages:
- End2End - End2End
- Deploy - Deploy
before_script:
- if [[ "$CI_PROJECT_PATH" != "bec/bec_widgets" ]]; then
test -d bec_widgets || git clone --branch $CHILD_PIPELINE_BRANCH https://gitlab.psi.ch/bec/bec_widgets.git; cd bec_widgets;
fi
formatter: formatter:
stage: Formatter stage: Formatter
needs: [] needs: []
@ -38,6 +44,9 @@ formatter:
- pip install black isort - pip install black isort
- isort --check --diff --line-length=100 --profile=black --multi-line=3 --trailing-comma ./ - isort --check --diff --line-length=100 --profile=black --multi-line=3 --trailing-comma ./
- black --check --diff --color --line-length=100 ./ - black --check --diff --color --line-length=100 ./
rules:
- if: $CI_PROJECT_PATH == "bec/bec_widgets"
pylint: pylint:
stage: Formatter stage: Formatter
needs: [] needs: []
@ -54,6 +63,8 @@ pylint:
paths: paths:
- ./pylint/ - ./pylint/
expire_in: 1 week expire_in: 1 week
rules:
- if: $CI_PROJECT_PATH == "bec/bec_widgets"
pylint-check: pylint-check:
stage: Formatter stage: Formatter
@ -85,6 +96,8 @@ pylint-check:
paths: paths:
- ./pylint/ - ./pylint/
expire_in: 1 week expire_in: 1 week
rules:
- if: $CI_PROJECT_PATH == "bec/bec_widgets"
tests: tests:
stage: test stage: test
@ -165,6 +178,7 @@ end-2-end-conda:
- if: '$CI_PIPELINE_SOURCE == "schedule"' - if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_PIPELINE_SOURCE == "web"' - if: '$CI_PIPELINE_SOURCE == "web"'
- if: '$CI_PIPELINE_SOURCE == "pipeline"' - if: '$CI_PIPELINE_SOURCE == "pipeline"'
- if: '$CI_PIPELINE_SOURCE == "parent_pipeline"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"' - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "production"' - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "production"'
@ -196,7 +210,7 @@ semver:
allow_failure: false allow_failure: false
rules: rules:
- if: '$CI_COMMIT_REF_NAME == "main"' - if: '$CI_COMMIT_REF_NAME == "main" && $CI_PROJECT_PATH == "bec/bec_widgets"'
pages: pages:
stage: Deploy stage: Deploy
@ -207,6 +221,6 @@ pages:
- if: '$CI_COMMIT_TAG != null' - if: '$CI_COMMIT_TAG != null'
variables: variables:
TARGET_BRANCH: $CI_COMMIT_TAG TARGET_BRANCH: $CI_COMMIT_TAG
- if: '$CI_COMMIT_REF_NAME == "main"' - if: '$CI_COMMIT_REF_NAME == "main" && $CI_PROJECT_PATH == "bec/bec_widgets"'
script: script:
- curl -X POST -d "branches=$CI_COMMIT_REF_NAME" -d "token=$RTD_TOKEN" https://readthedocs.org/api/v2/webhook/bec_widgets/253243/ - curl -X POST -d "branches=$CI_COMMIT_REF_NAME" -d "token=$RTD_TOKEN" https://readthedocs.org/api/v2/webhook/bec_widgets/253243/