diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 776056bf89274b2fe88bc44c7946e15584eec877..30e7168ed16f87f7b189c85a4b03d29fc73ec321 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,22 +24,22 @@ default: # Required for Manual runs through UI variables: - ENABLE_TEST: - value: "False" + WEB_ENABLE_TEST: + value: "True" options: - "True" - "False" - description: True to run test job. Defaults to false. - ENABLE_AUTOBRANCH: - value: "False" + description: True to run test job when triggered via Web UI. + WEB_ENABLE_AUTOBRANCH: + value: "True" options: - "True" - "False" - description: True to run Autobranch job. Defaults to false. Autobranch is allowed only on main. + description: True to run test job when triggered via Web UI. Test: rules: - - if: $CI_PIPELINE_SOURCE == "web" && $ENABLE_TEST == "True" + - if: $CI_PIPELINE_SOURCE == "web" && $WEB_ENABLE_TEST == "True" - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH parallel: @@ -73,7 +73,7 @@ Autobranch: # request branch for safety reasons. GIT_STRATEGY: none rules: - - if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $ENABLE_AUTOBRANCH == "True" + - if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $WEB_ENABLE_AUTOBRANCH == "True" - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /(^|,)autobranch($|,)/ resource_group: autobranch @@ -81,9 +81,13 @@ Autobranch: - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update -y - sudo apt-get upgrade -y - - sudo apt-get install -y tzdata git python3.10-full + - sudo apt-get install -y git python3-full - | + # Avoid using /tmp since it's probably in tmpfs and would consume RAM + export TMPDIR=$(readlink -f .)/tmp + mkdir -p "$TMPDIR" + origin_repo=$(mktemp -d) git clone -b "$CI_DEFAULT_BRANCH" "$CI_REPOSITORY_URL" "$origin_repo" @@ -149,8 +153,33 @@ Autobranch: exit $ret -Autobranch-manual: - needs: ['Autobranch'] - when: manual - allow_failure: false # Set to false to return to the previous behavior. - script: exit 0 + +pages: + needs: ['Autobranch', 'Test'] + resource_group: pages + + artifacts: + paths: + - doc/public + publish: doc/public + + rules: + - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + + before_script: + - PYVERSION=10 + - sudo sh -c 'echo "APT::Acquire::Retries=3;" >> /etc/apt/apt.conf.d/99retry-downloads' + - export DEBIAN_FRONTEND=noninteractive + - sudo apt-get update -y + - sudo apt-get upgrade -y + - sudo apt-get -y install python3.${PYVERSION}-full + - echo "$(python3 --version)" + + script: + - export LISA_PYTHON=python3.${PYVERSION} + - sudo ./install_base.sh --install-doc-extras + - source init_env + - | + set -e + cd doc/ + sphinx-build -b html . "public/$CI_COMMIT_BRANCH"