Merge branch 'maint-0.4.4' into release-0.4.4
[tor.git] / .gitlab-ci.yml
blob5a46c1a0e37461c8c8a74ccad89ceaa981052c27
1 ####
2 # DO NOT EDIT THIS FILE IN MASTER.  ONLY EDIT IT IN THE OLDEST SUPPORTED
3 # BRANCH, THEN MERGE FORWARD.
4 ####
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.
25 variables:
26   TERM: "ansi"
27   DEBUG_CI: "yes"
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
33   artifacts:
34     name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
35     expire_in: 1 week
36     when: always
37     paths:
38       - artifacts/
40 .apt-template: &apt-template |
41       export LC_ALL=C.UTF-8
42       echo Etc/UTC > /etc/timezone
43       mkdir -p apt-cache
44       export APT_CACHE_DIR="$(pwd)/apt-cache"
45       echo 'quiet "1";' \
46            'APT::Install-Recommends "0";' \
47            'APT::Install-Suggests "0";' \
48            'APT::Acquire::Retries "20";' \
49            'APT::Get::Assume-Yes "true";' \
50            'Dpkg::Use-Pty "0";' \
51            "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
52         >> /etc/apt/apt.conf.d/99gitlab
53       apt-get update -qq
54       apt-get upgrade -qy
56 .debian-template: &debian-template
57   <<: *artifacts-template
58   variables:
59     DEBIAN_FRONTEND: "noninteractive"
60   cache:
61     key: apt
62     paths:
63       - apt-cache
64   before_script:
65     - *apt-template
66     - apt-get install
67         automake
68         build-essential
69         git
70         libevent-dev
71         liblzma-dev
72         libscrypt-dev
73         libseccomp-dev
74         libssl-dev
75         pkg-config
76         python3
77         zlib1g-dev
78     - if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
79     - if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
81 debian-minimal:
82   image: debian:stable
83   <<: *debian-template
84   script:
85     - ./scripts/ci/ci-driver.sh
87 ###############################################
88 # Temporarily diabled. This one just takes too long to finish right now!
89 # Maybe we need to divide the call to ./src/test/test into a few segments,
90 # that all end in similar amount of time?
91 #debian-hardened:
92 #  image: debian:testing
93 #  <<: *debian-template
94 #  variables:
95 #    HARDENING: "yes"
96 #  script:
97 #    - ./scripts/ci/ci-driver.sh
99 debian-distcheck:
100   image: debian:stable
101   <<: *debian-template
102   variables:
103     DISTCHECK: "yes"
104     CHECK: "no"
105   script:
106     - ./scripts/ci/ci-driver.sh
108 debian-docs:
109   image: debian:stable
110   <<: *debian-template
111   variables:
112     DOXYGEN: "no"
113     ASCIIDOC: "no"
114     CHECK: "no"
115   script:
116     - ./scripts/ci/ci-driver.sh