2020-08-11 16:44:32 +02:00
|
|
|
####
|
|
|
|
# DO NOT EDIT THIS FILE IN MASTER. ONLY EDIT IT IN THE OLDEST SUPPORTED
|
|
|
|
# BRANCH, THEN MERGE FORWARD.
|
|
|
|
####
|
|
|
|
|
2020-08-10 22:10:12 +02:00
|
|
|
# This file controls how gitlab validates Tor commits and merge requests.
|
|
|
|
#
|
|
|
|
# It is primarily based on a set of scripts and configurations by
|
|
|
|
# Hans-Christoph Steiner. It only copies parts of those scripts and
|
|
|
|
# configurations for now. If you want a new piece of functionality
|
|
|
|
# (more debians, more fedoras, android support) then you shouldn't
|
|
|
|
# start from scratch: have a look at the original ticket, at
|
|
|
|
# https://gitlab.torproject.org/tpo/core/tor/-/issues/32193 !
|
|
|
|
#
|
|
|
|
# The file to copy from is
|
|
|
|
# https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/96/diffs#diff-content-587d266bb27a4dc3022bbed44dfa19849df3044c
|
|
|
|
#
|
|
|
|
# Having said that, if there is anything really stupid here, don't
|
|
|
|
# blame it on Hans-Christoph! Tor probably added it on their own.
|
|
|
|
#
|
|
|
|
# Copyright 2020, The Tor Project, Inc.
|
|
|
|
# See LICENSE for licence information.
|
2020-08-06 18:42:14 +02:00
|
|
|
|
2020-08-10 22:10:12 +02:00
|
|
|
# These variables are set everywhere, unconditionally.
|
|
|
|
variables:
|
|
|
|
TERM: "ansi"
|
|
|
|
DEBUG_CI: "yes"
|
2017-09-01 18:56:58 +02:00
|
|
|
|
2020-08-10 22:10:12 +02:00
|
|
|
# This template is for exporting ephemeral things from the scripts. By
|
|
|
|
# convention we expect our scripts to copy stuff into artifacts/, rather than
|
|
|
|
# having a big list of files that be treated as artifacts.
|
|
|
|
.artifacts-template: &artifacts-template
|
|
|
|
artifacts:
|
|
|
|
name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
|
|
|
|
expire_in: 1 week
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- artifacts/
|
|
|
|
|
2021-09-13 18:05:58 +02:00
|
|
|
|
|
|
|
# This template is used for x86-64 builds.
|
|
|
|
.x86-64-template: &x86-64-template
|
|
|
|
tags:
|
|
|
|
- amd64
|
|
|
|
|
2020-09-18 21:55:02 +02:00
|
|
|
# This template should be usable on any system that's based on apt.
|
2020-08-10 22:10:12 +02:00
|
|
|
.apt-template: &apt-template |
|
|
|
|
export LC_ALL=C.UTF-8
|
|
|
|
echo Etc/UTC > /etc/timezone
|
|
|
|
mkdir -p apt-cache
|
|
|
|
export APT_CACHE_DIR="$(pwd)/apt-cache"
|
|
|
|
echo 'quiet "1";' \
|
|
|
|
'APT::Install-Recommends "0";' \
|
|
|
|
'APT::Install-Suggests "0";' \
|
|
|
|
'APT::Acquire::Retries "20";' \
|
|
|
|
'APT::Get::Assume-Yes "true";' \
|
|
|
|
'Dpkg::Use-Pty "0";' \
|
|
|
|
"Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
|
|
|
|
>> /etc/apt/apt.conf.d/99gitlab
|
|
|
|
apt-get update -qq
|
|
|
|
apt-get upgrade -qy
|
|
|
|
|
2020-09-18 21:55:02 +02:00
|
|
|
# This template sets us up for Debian system in particular.
|
2020-08-10 22:10:12 +02:00
|
|
|
.debian-template: &debian-template
|
|
|
|
<<: *artifacts-template
|
2021-09-13 18:05:58 +02:00
|
|
|
<<: *x86-64-template
|
2020-08-10 22:10:12 +02:00
|
|
|
variables:
|
|
|
|
DEBIAN_FRONTEND: "noninteractive"
|
2020-08-13 02:20:58 +02:00
|
|
|
# TODO: Using "cache" in this way speeds up our downloads. It would be
|
|
|
|
# even better, though, to start with a pre-upgraded debian image.
|
|
|
|
#
|
|
|
|
# TODO: Will we have to do this differently once we have more than one
|
|
|
|
# debian version that we're using?
|
2020-08-10 22:10:12 +02:00
|
|
|
cache:
|
|
|
|
key: apt
|
|
|
|
paths:
|
|
|
|
- apt-cache
|
|
|
|
before_script:
|
|
|
|
- *apt-template
|
2020-08-13 02:20:58 +02:00
|
|
|
# Install patches unconditionally.
|
2020-08-10 22:10:12 +02:00
|
|
|
- apt-get install
|
|
|
|
automake
|
|
|
|
build-essential
|
2020-08-12 15:38:19 +02:00
|
|
|
ca-certificates
|
2020-08-10 22:10:12 +02:00
|
|
|
git
|
|
|
|
libevent-dev
|
|
|
|
liblzma-dev
|
|
|
|
libscrypt-dev
|
|
|
|
libseccomp-dev
|
|
|
|
libssl-dev
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
zlib1g-dev
|
2020-08-13 02:20:58 +02:00
|
|
|
# Install patches that we only need for some use cases.
|
2020-08-10 22:10:12 +02:00
|
|
|
- if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
|
|
|
|
- if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
|
2020-08-12 15:38:19 +02:00
|
|
|
- if [ "$STEM" = yes ]; then apt-get install timelimit; fi
|
|
|
|
- if [ "$CC" = clang ]; then apt-get install clang; fi
|
2020-09-21 15:26:57 +02:00
|
|
|
- if [ "$NSS" = yes ]; then apt-get install libnss3 libnss3-dev; fi
|
2020-08-13 02:20:58 +02:00
|
|
|
# TODO: This next line should not be debian-only.
|
2020-08-12 15:38:19 +02:00
|
|
|
- if [ "$STEM" = yes ]; then git clone --depth 1 https://git.torproject.org/stem.git ; export STEM_PATH="$(pwd)/stem"; fi
|
2020-08-13 02:20:58 +02:00
|
|
|
# TODO: This next line should not be debian-only.
|
2020-08-12 15:38:19 +02:00
|
|
|
- if [ "$CHUTNEY" = yes ]; then git clone --depth 1 https://git.torproject.org/chutney.git ; export CHUTNEY_PATH="$(pwd)/chutney"; fi
|
2020-09-18 21:53:06 +02:00
|
|
|
- if [ "$TRACING" = yes ]; then apt install liblttng-ust-dev; fi
|
2020-08-10 22:10:12 +02:00
|
|
|
|
2020-08-13 02:20:58 +02:00
|
|
|
# Minmal check on debian: just make, make check.
|
|
|
|
#
|
2020-08-10 22:10:12 +02:00
|
|
|
debian-minimal:
|
2021-08-16 15:57:56 +02:00
|
|
|
image: debian:buster
|
2020-08-10 22:10:12 +02:00
|
|
|
<<: *debian-template
|
2017-09-01 18:54:37 +02:00
|
|
|
script:
|
2020-08-10 22:10:12 +02:00
|
|
|
- ./scripts/ci/ci-driver.sh
|
|
|
|
|
2020-08-13 02:20:58 +02:00
|
|
|
#####
|
|
|
|
# Run "make check" with a hardened clang on debian stable. This takes
|
|
|
|
# care of a hardening check, and a compile-with-clang check.
|
|
|
|
#
|
2020-08-13 02:13:18 +02:00
|
|
|
# TODO: This will be faster once we merge #40098 and #40099.
|
2020-08-12 15:38:19 +02:00
|
|
|
debian-hardened:
|
2021-08-16 15:52:58 +02:00
|
|
|
image: debian:bullseye
|
2020-08-12 15:38:19 +02:00
|
|
|
<<: *debian-template
|
|
|
|
variables:
|
2020-09-21 15:25:02 +02:00
|
|
|
ALL_BUGS_ARE_FATAL: "yes"
|
2020-08-12 15:38:19 +02:00
|
|
|
HARDENING: "yes"
|
|
|
|
CC: "clang"
|
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|
2017-08-16 18:56:21 +02:00
|
|
|
|
2020-08-13 02:20:58 +02:00
|
|
|
#####
|
|
|
|
# Distcheck on debian stable
|
2020-08-10 22:10:12 +02:00
|
|
|
debian-distcheck:
|
2021-08-16 15:57:56 +02:00
|
|
|
image: debian:buster
|
2020-08-10 22:10:12 +02:00
|
|
|
<<: *debian-template
|
|
|
|
variables:
|
|
|
|
DISTCHECK: "yes"
|
|
|
|
CHECK: "no"
|
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|
|
|
|
|
2020-08-13 02:20:58 +02:00
|
|
|
#####
|
|
|
|
# Documentation tests on debian stable: doxygen and asciidoc.
|
2020-08-10 22:10:12 +02:00
|
|
|
debian-docs:
|
2021-08-16 15:57:56 +02:00
|
|
|
image: debian:buster
|
2020-08-10 22:10:12 +02:00
|
|
|
<<: *debian-template
|
|
|
|
variables:
|
2020-08-11 17:06:21 +02:00
|
|
|
DOXYGEN: "yes"
|
|
|
|
ASCIIDOC: "yes"
|
2020-08-10 22:10:12 +02:00
|
|
|
CHECK: "no"
|
2020-08-12 17:35:15 +02:00
|
|
|
RUN_STAGE_BUILD: "no"
|
2020-08-10 22:10:12 +02:00
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|
2020-08-12 15:38:19 +02:00
|
|
|
|
2020-08-13 02:20:58 +02:00
|
|
|
#####
|
|
|
|
# Integration tests on debian stable: chutney and stem.
|
|
|
|
#
|
|
|
|
# TODO: It would be cool if this target didn't have to re-build tor, and
|
|
|
|
# could instead re-use Tor from debian-minimal. That can be done
|
|
|
|
# with the 'artifacts' mechanism, in theory, but it would be good to
|
|
|
|
# avoid having to have a system with hundreds of artifacts.
|
2020-08-12 15:38:19 +02:00
|
|
|
debian-integration:
|
2021-08-16 15:57:56 +02:00
|
|
|
image: debian:buster
|
2020-08-12 15:38:19 +02:00
|
|
|
<<: *debian-template
|
|
|
|
variables:
|
|
|
|
CHECK: "no"
|
|
|
|
CHUTNEY: "yes"
|
2020-09-21 15:49:29 +02:00
|
|
|
CHUTNEY_MAKE_TARGET: "test-network-all"
|
2020-08-13 02:13:18 +02:00
|
|
|
STEM: "yes"
|
2020-09-21 15:25:02 +02:00
|
|
|
ALL_BUGS_ARE_FATAL: "yes"
|
2020-08-12 15:38:19 +02:00
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|
2020-09-18 21:53:06 +02:00
|
|
|
|
|
|
|
#####
|
|
|
|
# Tracing build on Debian stable.
|
|
|
|
debian-tracing:
|
2021-08-16 15:57:56 +02:00
|
|
|
image: debian:buster
|
2020-09-18 21:53:06 +02:00
|
|
|
<<: *debian-template
|
|
|
|
variables:
|
|
|
|
TRACING: "yes"
|
|
|
|
CHECK: "no"
|
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|
2020-09-18 21:56:59 +02:00
|
|
|
# Ensure that we only run tracing when it's implemented.
|
|
|
|
#
|
|
|
|
# Once versions before 0.4.5 are obsolete, we can remove this test.
|
|
|
|
rules:
|
|
|
|
# This first "if" check prevents us from running a duplicate version of
|
|
|
|
# this pipeline whenever we push and create an MR. I don't understand why
|
|
|
|
# it is necessary, though the following URL purports to explain:
|
|
|
|
#
|
|
|
|
# https://docs.gitlab.com/ee/ci/yaml/#prevent-duplicate-pipelines
|
|
|
|
- if: '$CI_PIPELINE_SOURCE == "push"'
|
|
|
|
exists:
|
|
|
|
- src/lib/trace/trace_sys.c
|
2020-09-21 15:24:14 +02:00
|
|
|
|
|
|
|
#####
|
|
|
|
# No-authority mode
|
|
|
|
debian-disable-dirauth:
|
2021-08-16 15:57:56 +02:00
|
|
|
image: debian:buster
|
2020-09-21 15:24:14 +02:00
|
|
|
<<: *debian-template
|
|
|
|
variables:
|
|
|
|
DISABLE_DIRAUTH: "yes"
|
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|
|
|
|
|
|
|
|
#####
|
|
|
|
# No-relay mode
|
|
|
|
debian-disable-relay:
|
2021-08-16 15:57:56 +02:00
|
|
|
image: debian:buster
|
2020-09-21 15:24:14 +02:00
|
|
|
<<: *debian-template
|
|
|
|
variables:
|
|
|
|
DISABLE_RELAY: "yes"
|
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|
|
|
|
# Ensure that we only run tracing when it's implemented.
|
|
|
|
#
|
|
|
|
# Once versions before 0.4.3 are obsolete, we can remove this test.
|
|
|
|
rules:
|
|
|
|
# This first "if" check prevents us from running a duplicate version of
|
|
|
|
# this pipeline whenever we push and create an MR. I don't understand why
|
|
|
|
# it is necessary, though the following URL purports to explain:
|
|
|
|
#
|
|
|
|
# https://docs.gitlab.com/ee/ci/yaml/#prevent-duplicate-pipelines
|
|
|
|
- if: '$CI_PIPELINE_SOURCE == "push"'
|
|
|
|
exists:
|
|
|
|
- src/feature/relay/relay_stub.c
|
2020-09-21 15:26:57 +02:00
|
|
|
|
|
|
|
#####
|
|
|
|
# NSS check on debian
|
|
|
|
debian-nss:
|
2021-08-16 15:57:56 +02:00
|
|
|
image: debian:buster
|
2020-09-21 15:26:57 +02:00
|
|
|
<<: *debian-template
|
|
|
|
variables:
|
|
|
|
NSS: "yes"
|
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|