Revision 91d37b3316ba8753026246327383452bc8733d66 authored by François Thiré on 12 February 2024, 12:25:10 UTC, committed by François Thiré on 12 February 2024, 12:26:37 UTC
1 parent 765f7bc
.gitlab-ci.yml
---
# General setup
default:
interruptible: true
# Basic configuration to guard against double-pipelines
workflow:
name: "[$PIPELINE_TYPE] $CI_COMMIT_TITLE"
rules:
# /!\ These rules should be mutually exclusive and kept in sync
# with the corresponding 'if'-rules on the pipeline includes
# below.
# Allow 'Before merging' pipelines
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "merge_request_event"'
variables:
PIPELINE_TYPE: 'before_merging'
# Allow 'Latest release' pipelines
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "latest-release"'
variables:
PIPELINE_TYPE: 'latest_release'
# Allow 'Test latest release' pipelines for dry running latest
# release pipelines in the nomadic-labs/tezos CI.
- if: '$CI_PROJECT_NAMESPACE != "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "latest-release-test"'
variables:
PIPELINE_TYPE: 'latest_release_test'
# Allow 'Master branch' pipelines
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "master"'
variables:
PIPELINE_TYPE: 'master_branch'
# Allow 'Release tag' pipelines
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+(?:\-rc\d+)?$/'
variables:
PIPELINE_TYPE: 'release_tag'
# Allow 'Beta release tag' pipelines
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+\-beta\d*$/'
variables:
PIPELINE_TYPE: 'beta_release_tag'
# Allow 'Test release tag' pipelines for dry running release tag
# pipelines in the nomadic-labs/tezos CI.
- if: '$CI_PROJECT_NAMESPACE != "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+(?:\-(rc|beta)\d*)?$/'
variables:
PIPELINE_TYPE: 'release_tag_test'
# Allow 'Non-release tag' pipelines
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG != null && $CI_COMMIT_TAG !~ /^v\d+\.\d+(?:\-(rc|beta)\d*)?$/'
variables:
PIPELINE_TYPE: 'non_release_tag'
# Allow 'Test non-release tag' pipelines for dry running non-release tag
# pipelines in the nomadic-labs/tezos CI.
- if: '$CI_PROJECT_NAMESPACE != "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG != null && $CI_COMMIT_TAG !~ /^v\d+\.\d+(?:\-(rc|beta)\d*)?$/'
variables:
PIPELINE_TYPE: 'non_release_tag_test'
# Allow 'Scheduled pipeline for extended test' pipelines
- if: '$CI_PIPELINE_SOURCE == "schedule" && $TZ_SCHEDULE_KIND == "EXTENDED_TESTS"'
variables:
PIPELINE_TYPE: 'schedule_extended_test'
# Disallow all other pipelines
- when: never
variables:
# /!\ CI_REGISTRY is overriden to use a private Docker registry mirror in AWS ECR
# in GitLab namespaces `nomadic-labs` and `tezos`
## This value MUST be the same as `opam_repository_tag` in `scripts/version.sh`
build_deps_image_version: 20f6d5155c58370038a2d23d46925c96eb174cd4
build_deps_image_name: "${CI_REGISTRY}/tezos/opam-repository"
# This image is not automatically mirrored to AWS ECR and should be
# fetch from the GitLab registry, so do not use CI_REGISTRY here.
rust_toolchain_image_name: "registry.gitlab.com/${CI_PROJECT_PATH}/rust-toolchain"
GIT_STRATEGY: fetch
GIT_DEPTH: "1"
GET_SOURCES_ATTEMPTS: "2"
ARTIFACT_DOWNLOAD_ATTEMPTS: "2"
# Sets the number of tries before failing opam downloads.
OPAMRETRIES: "5"
# An addition to working around a bug in gitlab-runner's default
# unzipping implementation (https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27496),
# this setting cuts cache creation time.
FF_USE_FASTZIP: "true"
# TODO: https://gitlab.com/tezos/tezos/-/issues/6764
# "false" is the GitLab default but we've overridden it in the runner settings.
# This should be fixed at the runner level but we reset it to the
# default here in the meantime.
FF_KUBERNETES_HONOR_ENTRYPOINT: "false"
# If `RUNTEZTALIAS` is true, then Tezt tests are included in the @runtest
# alias. We set it to false to deactivate these tests in the unit
# test jobs, as they already run in the Tezt jobs. It is set to true
# in the opam jobs where we want to run the tests `--with-test`. It is set
# to true in the `unit:js_component`, as there is not global Tezt job
# for js tests.
RUNTEZTALIAS: "false"
# Image templates
.image_template__runtime_e2etest_dependencies:
image: ${build_deps_image_name}:runtime-e2etest-dependencies--${build_deps_image_version}
.image_template__runtime_build_test_dependencies:
image: ${build_deps_image_name}:runtime-build-test-dependencies--${build_deps_image_version}
.image_template__runtime_build_dependencies:
image: ${build_deps_image_name}:runtime-build-dependencies--${build_deps_image_version}
.image_template__runtime_prebuild_dependencies:
image: ${build_deps_image_name}:runtime-prebuild-dependencies--${build_deps_image_version}
.image_template__client_libs_dependencies:
image: ${build_deps_image_name}:client-libs-dependencies--${build_deps_image_version}
.image_template__rust_toolchain:
image: ${rust_toolchain_image_name}:${CI_COMMIT_SHA}
# Match GitLab executors version and directly use the Docker socket
# The Docker daemon is already configured, experimental features are enabled
# The following environment variables are already set:
# - BUILDKIT_PROGRESS
# - DOCKER_DRIVER
# - DOCKER_VERSION
# https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-socket-binding
.image_template__docker:
# https://gitlab.com/tezos/docker-images/ci-docker
image: "${CI_REGISTRY}/tezos/docker-images/ci-docker:v1.9.0"
.image_template__alpine:
# The Alpine version should be kept up to date with the version used
# for the `build_deps_image_name` images and specified in the
# variable `alpine_version` in `scripts/version.sh`. This is checked
# by the jobs `trigger` and `sanity_ci`.
image: alpine:3.18
# The "manual" stage exists to fix a UI problem that occurs when mixing
# manual and non-manual jobs.
stages:
- trigger
- sanity
- build
- test
- test_coverage
- packaging
- doc
- prepare_release
- publish_release_gitlab
- publish_release
- publish_package_gitlab
- manual
# Dummy job.
#
# This fixes the "configuration must contain at least one
# visible job" error in GitLab when using includes.
#
# For more info, see: https://gitlab.com/gitlab-org/gitlab/-/issues/341693
dummy_job:
rules:
- if: '"foo" == "bar"'
script:
- 'echo "This job will never execute"'
include:
# /!\ These rules should be be mutually exclusive and kept in sync
# with the corresponding 'if'-rules on the workflow rules above.
# Common templates
- local: .gitlab/ci/jobs/shared/templates.yml
# Before merging
- local: .gitlab/ci/pipelines/before_merging.yml
rules:
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "merge_request_event"'
# Latest release
- local: .gitlab/ci/pipelines/latest_release.yml
rules:
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "latest-release"'
# Test latest release
- local: .gitlab/ci/pipelines/latest_release_test.yml
rules:
- if: '$CI_PROJECT_NAMESPACE != "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "latest-release-test"'
# Master branch
- local: .gitlab/ci/pipelines/master_branch.yml
rules:
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "master"'
# Release tag
- local: .gitlab/ci/pipelines/release_tag.yml
rules:
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+(?:\-rc\d+)?$/'
# Beta release tag
- local: .gitlab/ci/pipelines/beta_release_tag.yml
rules:
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+\-beta\d*$/'
# Test release tag
- local: .gitlab/ci/pipelines/release_tag_test.yml
rules:
- if: '$CI_PROJECT_NAMESPACE != "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+(?:\-(rc|beta)\d*)?$/'
# Non-release tag
- local: .gitlab/ci/pipelines/non_release_tag.yml
rules:
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG != null && $CI_COMMIT_TAG !~ /^v\d+\.\d+(?:\-(rc|beta)\d*)?$/'
# Test non-release tag
- local: .gitlab/ci/pipelines/non_release_tag_test.yml
rules:
- if: '$CI_PROJECT_NAMESPACE != "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG != null && $CI_COMMIT_TAG !~ /^v\d+\.\d+(?:\-(rc|beta)\d*)?$/'
# Scheduled pipeline for extended test
- local: .gitlab/ci/pipelines/schedule_extended_test.yml
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $TZ_SCHEDULE_KIND == "EXTENDED_TESTS"'
Computing file changes ...