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
|
2023-08-02 19:30:28 +02:00
|
|
|
- physical
|
2021-09-13 18:05:58 +02:00
|
|
|
|
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"
|
2023-05-30 18:53:09 +02:00
|
|
|
rm -f /etc/apt/apt.conf.d/docker-clean
|
2020-08-10 22:10:12 +02:00
|
|
|
echo 'quiet "1";' \
|
2023-04-11 16:26:20 +02:00
|
|
|
'Acquire::Retries "20";' \
|
2020-08-10 22:10:12 +02:00
|
|
|
'APT::Install-Recommends "0";' \
|
|
|
|
'APT::Install-Suggests "0";' \
|
|
|
|
'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
|
2023-05-30 18:53:09 +02:00
|
|
|
apt-utils
|
2020-08-10 22:10:12 +02:00
|
|
|
automake
|
|
|
|
build-essential
|
2020-08-12 15:38:19 +02:00
|
|
|
ca-certificates
|
2023-05-30 18:53:09 +02:00
|
|
|
file
|
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
|
2022-04-26 15:39:20 +02:00
|
|
|
# llvm-symbolizer for sanitizer backtrace
|
|
|
|
- if [ "$HARDENING" = yes ]; then apt-get install llvm; fi
|
2020-08-13 02:20:58 +02:00
|
|
|
# TODO: This next line should not be debian-only.
|
2023-06-19 14:09:24 +02:00
|
|
|
- if [ "$STEM" = yes ]; then git clone --depth 1 https://gitlab.torproject.org/tpo/network-health/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.
|
2023-06-15 19:00:11 +02:00
|
|
|
- if [ "$CHUTNEY" = yes ]; then git clone --depth 1 https://gitlab.torproject.org/tpo/core/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-11-11 12:38:19 +01:00
|
|
|
# Minimal check on debian: just make, make check.
|
2020-08-13 02:20:58 +02:00
|
|
|
#
|
2020-08-10 22:10:12 +02:00
|
|
|
debian-minimal:
|
2023-05-30 18:53:09 +02:00
|
|
|
image: debian:bullseye
|
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
|
|
|
|
|
2022-03-27 21:21:40 +02:00
|
|
|
# Minimal check on debian/i386: just make, make check.
|
2021-11-03 13:36:30 +01:00
|
|
|
#
|
|
|
|
debian-i386-minimal:
|
2023-05-30 18:53:09 +02:00
|
|
|
image: i386/debian:bullseye
|
2021-11-03 13:36:30 +01:00
|
|
|
<<: *debian-template
|
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|
2023-08-25 10:14:04 +02:00
|
|
|
tags:
|
|
|
|
- physical
|
2021-11-03 13:36:30 +01:00
|
|
|
|
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:
|
2023-05-30 18:53:09 +02:00
|
|
|
image: debian:bullseye
|
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:
|
2023-05-30 18:53:09 +02:00
|
|
|
image: debian:bullseye
|
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:
|
2023-05-30 18:53:09 +02:00
|
|
|
image: debian:bullseye
|
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:
|
2023-05-30 18:53:09 +02:00
|
|
|
image: debian:bullseye
|
2020-09-18 21:53:06 +02:00
|
|
|
<<: *debian-template
|
|
|
|
variables:
|
|
|
|
TRACING: "yes"
|
|
|
|
CHECK: "no"
|
2020-11-03 14:36:02 +01:00
|
|
|
DISTCHECK: "yes"
|
2020-09-18 21:53:06 +02:00
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|
2020-09-21 15:24:14 +02:00
|
|
|
|
|
|
|
#####
|
|
|
|
# No-authority mode
|
|
|
|
debian-disable-dirauth:
|
2023-05-30 18:53:09 +02:00
|
|
|
image: debian:bullseye
|
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:
|
2023-05-30 18:53:09 +02:00
|
|
|
image: debian:bullseye
|
2020-09-21 15:24:14 +02:00
|
|
|
<<: *debian-template
|
|
|
|
variables:
|
|
|
|
DISABLE_RELAY: "yes"
|
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|
2020-09-21 15:26:57 +02:00
|
|
|
|
2023-03-10 00:37:25 +01:00
|
|
|
#####
|
|
|
|
# GPL licensed mode, enables pow module
|
|
|
|
debian-gpl:
|
|
|
|
image: debian:buster
|
|
|
|
<<: *debian-template
|
|
|
|
variables:
|
|
|
|
GPL: "yes"
|
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|
|
|
|
|
2020-09-21 15:26:57 +02:00
|
|
|
#####
|
|
|
|
# NSS check on debian
|
|
|
|
debian-nss:
|
2023-05-30 18:53:09 +02:00
|
|
|
image: debian:bullseye
|
2020-09-21 15:26:57 +02:00
|
|
|
<<: *debian-template
|
|
|
|
variables:
|
|
|
|
NSS: "yes"
|
|
|
|
script:
|
|
|
|
- ./scripts/ci/ci-driver.sh
|
2022-02-15 23:07:24 +01:00
|
|
|
|
|
|
|
#####
|
|
|
|
# Debian packaging triggers for maintenance branches
|
|
|
|
debian-packaging-0.4.5:
|
|
|
|
stage: deploy
|
|
|
|
trigger:
|
|
|
|
project: tpo/core/debian/tor
|
|
|
|
branch: debian-0.4.5
|
|
|
|
rules:
|
|
|
|
- if: $CI_PROJECT_NAMESPACE == "tpo/core" &&
|
|
|
|
$CI_COMMIT_BRANCH == "maint-0.4.5"
|
|
|
|
debian-packaging-0.4.6:
|
|
|
|
stage: deploy
|
|
|
|
trigger:
|
|
|
|
project: tpo/core/debian/tor
|
|
|
|
branch: debian-0.4.6
|
|
|
|
rules:
|
|
|
|
- if: $CI_PROJECT_NAMESPACE == "tpo/core" &&
|
|
|
|
$CI_COMMIT_BRANCH == "maint-0.4.6"
|
2023-08-14 22:13:36 +02:00
|
|
|
|
|
|
|
#####
|
|
|
|
# Run tests written in Rust, and run clippy on all Rust code here.
|
|
|
|
rust-latest:
|
|
|
|
image: rust:latest
|
|
|
|
<<: *debian-template
|
|
|
|
script:
|
|
|
|
- apt-get install llvm-dev libclang-dev clang
|
|
|
|
- rustup show
|
|
|
|
- cargo build --locked --verbose
|
|
|
|
- cargo test --verbose
|
|
|
|
- rustup component add clippy
|
|
|
|
- rustup show
|
|
|
|
- cargo clippy --all-features --all-targets -- -D warnings
|
|
|
|
after_script:
|
|
|
|
- cargo clean
|