small code tweaks to try to work around debian stable complaints
[tor.git] / .gitlab-ci.yml
blobfc160ffaeabc210b751cbdcfdba1eba0728291e9
1 # This file controls how gitlab validates Tor commits and merge requests.
3 # It is primarily based on a set of scripts and configurations by
4 # Hans-Christoph Steiner.  It only copies parts of those scripts and
5 # configurations for now.  If you want a new piece of functionality
6 # (more debians, more fedoras, android support) then you shouldn't
7 # start from scratch: have a look at the original ticket, at
8 # https://gitlab.torproject.org/tpo/core/tor/-/issues/32193 !
10 # The file to copy from is
11 # https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/96/diffs#diff-content-587d266bb27a4dc3022bbed44dfa19849df3044c
13 # Having said that, if there is anything really stupid here, don't
14 # blame it on Hans-Christoph! Tor probably added it on their own.
16 # Copyright 2020, The Tor Project, Inc.
17 # See LICENSE for licence information.
19 # These variables are set everywhere, unconditionally.
20 variables:
21   TERM: "ansi"
22   DEBUG_CI: "yes"
24 # This template is for exporting ephemeral things from the scripts.  By
25 # convention we expect our scripts to copy stuff into artifacts/, rather than
26 # having a big list of files that be treated as artifacts.
27 .artifacts-template: &artifacts-template
28   artifacts:
29     name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
30     expire_in: 1 week
31     when: always
32     paths:
33       - artifacts/
35 .apt-template: &apt-template |
36       export LC_ALL=C.UTF-8
37       echo Etc/UTC > /etc/timezone
38       mkdir -p apt-cache
39       export APT_CACHE_DIR="$(pwd)/apt-cache"
40       echo 'quiet "1";' \
41            'APT::Install-Recommends "0";' \
42            'APT::Install-Suggests "0";' \
43            'APT::Acquire::Retries "20";' \
44            'APT::Get::Assume-Yes "true";' \
45            'Dpkg::Use-Pty "0";' \
46            "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
47         >> /etc/apt/apt.conf.d/99gitlab
48       apt-get update -qq
49       apt-get upgrade -qy
51 .debian-template: &debian-template
52   <<: *artifacts-template
53   variables:
54     DEBIAN_FRONTEND: "noninteractive"
55   cache:
56     key: apt
57     paths:
58       - apt-cache
59   before_script:
60     - *apt-template
61     - apt-get install
62         automake
63         build-essential
64         git
65         libevent-dev
66         liblzma-dev
67         libscrypt-dev
68         libseccomp-dev
69         libssl-dev
70         pkg-config
71         python3
72         zlib1g-dev
73     - if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
74     - if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
76 debian-minimal:
77   image: debian:stable
78   <<: *debian-template
79   script:
80     - ./scripts/ci/ci-driver.sh
82 ###############################################
83 # Temporarily diabled. This one just takes too long to finish right now!
84 # Maybe we need to divide the call to ./src/test/test into a few segments,
85 # that all end in similar amount of time?
86 #debian-hardened:
87 #  image: debian:testing
88 #  <<: *debian-template
89 #  variables:
90 #    HARDENING: "yes"
91 #  script:
92 #    - ./scripts/ci/ci-driver.sh
94 debian-distcheck:
95   image: debian:stable
96   <<: *debian-template
97   variables:
98     DISTCHECK: "yes"
99     CHECK: "no"
100   script:
101     - ./scripts/ci/ci-driver.sh
103 debian-docs:
104   image: debian:stable
105   <<: *debian-template
106   variables:
107     DOXYGEN: "no"
108     ASCIIDOC: "no"
109     CHECK: "no"
110   script:
111     - ./scripts/ci/ci-driver.sh