Revision 1ccd515362fd4409e2fce458b364bf069416aa70 authored by pecornilleau on 09 November 2023, 11:38:24 UTC, committed by pecornilleau on 09 November 2023, 11:38:24 UTC
1 parent 7efc040
.gitlab-ci.yml
---
# General setup
default:
interruptible: true
# Basic configuration to guard against double-pipelines
workflow:
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"'
# Allow 'Latest release' pipelines
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "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"'
# Allow 'Master branch' pipelines
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "master"'
# Allow 'Release tag' pipelines
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+(?:\-rc\d+)?$/'
# Allow 'Beta release tag' pipelines
- if: '$CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+\-beta\d*$/'
# 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*)?$/'
# 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*)?$/'
# 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*)?$/'
# Allow 'Scheduled pipeline for extended tests' pipelines
- if: '$CI_PIPELINE_SOURCE == "schedule" && $TZ_SCHEDULE_KIND == "EXTENDED_TESTS"'
# 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: b4951e9250185731d02d8e688fe79147ba4d1cd3
build_deps_image_name: "${CI_REGISTRY}/tezos/opam-repository"
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"
# 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.
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__rust_toolchain:
image: ${build_deps_image_name}:rust-toolchain--${build_deps_image_version}
# 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.6.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.17
# 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
# Trigger
#
# §1: The purpose of this job is to launch the CI manually in certain cases.
# The objective is not to run computing when it is not
# necessary and the decision to do so belongs to the developer
#
# §2: Gitlab CI needs at least one job definition, otherwise we're stuck with
# this error: 'Jobs config should contain at least one visible job'
trigger:
extends:
- .image_template__alpine
- .tags_template__gcp
stage: trigger
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_PROJECT_NAMESPACE == "tezos" && $CI_MERGE_REQUEST_ASSIGNEES !~ /nomadic-margebot/'
when: manual
- when: always
allow_failure: false
timeout: "10m"
script:
- echo 'Trigger pipeline 🤠'
# Check that the Alpine version of the trigger job's image
# corresponds to the value in scripts/version.sh.
- ./scripts/ci/check_alpine_version.sh
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 tests
- local: .gitlab/ci/pipelines/schedule_extended_test.yml
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $TZ_SCHEDULE_KIND == "EXTENDED_TESTS"'
Computing file changes ...