Newer
Older
##############################################################################
# CI for CEPCSW at IHEP GitLab
##############################################################################
workflow:
rules:
# These 3 rules from https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Workflows/MergeRequest-Pipelines.gitlab-ci.yml
# Run on merge requests
- if: $CI_MERGE_REQUEST_IID
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
# Run on tags
- if: $CI_COMMIT_TAG
# Run when called from an upstream pipeline https://docs.gitlab.com/ee/ci/pipelines/downstream_pipelines.html?tab=Multi-project+pipeline#use-rules-to-control-downstream-pipeline-jobs
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'parent-child'
# Run on commits to the default branch
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# The last rule above blocks manual and scheduled pipelines on non-default branch. The rule below allows them:
- if: $CI_PIPELINE_SOURCE == "schedule"
# Run if triggered from Web using 'Run Pipelines'
- if: $CI_PIPELINE_SOURCE == "web"
# Run if triggered from WebIDE
- if: $CI_PIPELINE_SOURCE == "webide"
stages:
- build
##############################################################################
##############################################################################
# Due to cmake/ctest will hardcode the path in build directory,
# the test job will be failed if it is executed on a different nodes.
# Therefore, put the build script and test script together.
.envvar_template:
variables:
CEPCSW_LCG_RELEASE: LCG
CEPCSW_LCG_PLATFORM: x86_64-el9-gcc11-opt
CEPCSW_LCG_VERSION: 105.0.0
# for k8s
.build_template_k8s:
extends: .envvar_template
image: cepc/cepcsw-cvmfs:el9
stage: build
tags:
- k8s # using k8s as runner
script:
- sed -i 's%^CVMFS_HTTP_PROXY=.*%CVMFS_HTTP_PROXY=http://squid-01.ihep.ac.cn:3128%' /etc/cvmfs/default.local
- for repo in sft.cern.ch geant4.cern.ch cepcsw.ihep.ac.cn; do [ -d "/cvmfs/$repo" ] || mkdir /cvmfs/$repo; sudo mount -t cvmfs $repo /cvmfs/$repo; done
- bash ./.build.ci.sh
- bash ./.test.ci.sh
##############################################################################
# Build & Test in k8s (LCG)
##############################################################################
build:lcg:el9:k8s:
extends: .build_template_k8s
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
when: manual
artifacts:
reports:
junit: build.${CEPCSW_LCG_VERSION}.${CEPCSW_LCG_PLATFORM}/cepcsw-ctest-result.xml
##############################################################################
# Build the docs
##############################################################################
build:docs:k8s:
extends: .build_template_k8s
image: sphinxdoc/sphinx
- bash build-docs.sh
- docs/build/html/
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- docs/**/*