2 # DO NOT EDIT THIS FILE IN MASTER. ONLY EDIT IT IN THE OLDEST SUPPORTED
3 # BRANCH, THEN MERGE FORWARD.
6 # This file controls how gitlab validates Tor commits and merge requests.
8 # It is primarily based on a set of scripts and configurations by
9 # Hans-Christoph Steiner. It only copies parts of those scripts and
10 # configurations for now. If you want a new piece of functionality
11 # (more debians, more fedoras, android support) then you shouldn't
12 # start from scratch: have a look at the original ticket, at
13 # https://gitlab.torproject.org/tpo/core/tor/-/issues/32193 !
15 # The file to copy from is
16 # https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/96/diffs#diff-content-587d266bb27a4dc3022bbed44dfa19849df3044c
18 # Having said that, if there is anything really stupid here, don't
19 # blame it on Hans-Christoph! Tor probably added it on their own.
21 # Copyright 2020, The Tor Project, Inc.
22 # See LICENSE for licence information.
24 # These variables are set everywhere, unconditionally.
29 # This template is for exporting ephemeral things from the scripts. By
30 # convention we expect our scripts to copy stuff into artifacts/, rather than
31 # having a big list of files that be treated as artifacts.
32 .artifacts-template: &artifacts-template
34 name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
41 # This template is used for x86-64 builds.
42 .x86-64-template: &x86-64-template
47 # This template should be usable on any system that's based on apt.
48 .apt-template: &apt-template |
50 echo Etc/UTC > /etc/timezone
52 export APT_CACHE_DIR="$(pwd)/apt-cache"
53 rm -f /etc/apt/apt.conf.d/docker-clean
55 'Acquire::Retries "20";' \
56 'APT::Install-Recommends "0";' \
57 'APT::Install-Suggests "0";' \
58 'APT::Get::Assume-Yes "true";' \
59 'Dpkg::Use-Pty "0";' \
60 "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
61 >> /etc/apt/apt.conf.d/99gitlab
65 # This template sets us up for Debian system in particular.
66 .debian-template: &debian-template
67 <<: *artifacts-template
70 DEBIAN_FRONTEND: "noninteractive"
71 # TODO: Using "cache" in this way speeds up our downloads. It would be
72 # even better, though, to start with a pre-upgraded debian image.
74 # TODO: Will we have to do this differently once we have more than one
75 # debian version that we're using?
82 # Install patches unconditionally.
98 # Install patches that we only need for some use cases.
99 - if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
100 - if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
101 - if [ "$STEM" = yes ]; then apt-get install timelimit; fi
102 - if [ "$CC" = clang ]; then apt-get install clang; fi
103 - if [ "$NSS" = yes ]; then apt-get install libnss3 libnss3-dev; fi
104 # llvm-symbolizer for sanitizer backtrace
105 - if [ "$HARDENING" = yes ]; then apt-get install llvm; fi
106 # TODO: This next line should not be debian-only.
107 - if [ "$STEM" = yes ]; then git clone --depth 1 https://gitlab.torproject.org/tpo/network-health/stem.git ; export STEM_PATH="$(pwd)/stem"; fi
108 # TODO: This next line should not be debian-only.
109 - if [ "$CHUTNEY" = yes ]; then git clone --depth 1 https://gitlab.torproject.org/tpo/core/chutney.git ; export CHUTNEY_PATH="$(pwd)/chutney"; fi
110 - if [ "$TRACING" = yes ]; then apt install liblttng-ust-dev; fi
112 # Minimal check on debian: just make, make check.
115 image: debian:bullseye
118 - ./scripts/ci/ci-driver.sh
120 # Minimal check on debian/i386: just make, make check.
123 image: i386/debian:bullseye
126 - ./scripts/ci/ci-driver.sh
131 # Run "make check" with a hardened clang on debian stable. This takes
132 # care of a hardening check, and a compile-with-clang check.
134 # TODO: This will be faster once we merge #40098 and #40099.
136 image: debian:bullseye
139 ALL_BUGS_ARE_FATAL: "yes"
143 - ./scripts/ci/ci-driver.sh
146 # Distcheck on debian stable
148 image: debian:bullseye
154 - ./scripts/ci/ci-driver.sh
157 # Documentation tests on debian stable: doxygen and asciidoc.
159 image: debian:bullseye
165 RUN_STAGE_BUILD: "no"
167 - ./scripts/ci/ci-driver.sh
170 # Integration tests on debian stable: chutney and stem.
172 # TODO: It would be cool if this target didn't have to re-build tor, and
173 # could instead re-use Tor from debian-minimal. That can be done
174 # with the 'artifacts' mechanism, in theory, but it would be good to
175 # avoid having to have a system with hundreds of artifacts.
177 image: debian:bullseye
182 CHUTNEY_MAKE_TARGET: "test-network-all"
184 ALL_BUGS_ARE_FATAL: "yes"
186 - ./scripts/ci/ci-driver.sh
189 # Tracing build on Debian stable.
191 image: debian:bullseye
198 - ./scripts/ci/ci-driver.sh
202 debian-disable-dirauth:
203 image: debian:bullseye
206 DISABLE_DIRAUTH: "yes"
208 - ./scripts/ci/ci-driver.sh
212 debian-disable-relay:
213 image: debian:bullseye
218 - ./scripts/ci/ci-driver.sh
221 # GPL licensed mode, enables pow module
228 - ./scripts/ci/ci-driver.sh
231 # NSS check on debian
233 image: debian:bullseye
238 - ./scripts/ci/ci-driver.sh
241 # Debian packaging triggers for maintenance branches
242 debian-packaging-0.4.5:
245 project: tpo/core/debian/tor
248 - if: $CI_PROJECT_NAMESPACE == "tpo/core" &&
249 $CI_COMMIT_BRANCH == "maint-0.4.5"
250 debian-packaging-0.4.6:
253 project: tpo/core/debian/tor
256 - if: $CI_PROJECT_NAMESPACE == "tpo/core" &&
257 $CI_COMMIT_BRANCH == "maint-0.4.6"
260 # Run tests written in Rust, and run clippy on all Rust code here.
265 - apt-get install llvm-dev libclang-dev clang
267 - cargo build --locked --verbose
268 - cargo test --verbose
269 - rustup component add clippy
271 - cargo clippy --all-features --all-targets -- -D warnings