summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 0f10d9fd67fc84909c045d7503e17cdc13c3b657 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
variables:
  BUILD_IMAGES_PROJECT: gnutls/build-images
  DEBIAN_CROSS_BUILD: buildenv-debian-cross
  FEDORA_BUILD: buildenv-fedora31
  DEBIAN_X86_CROSS_BUILD: buildenv-debian-x86-cross
  GET_SOURCES_ATTEMPTS: "3"

# remove any pre-installed headers from nettle
before_script:
 - yum remove -y nettle-devel

# See http://doc.gitlab.com/ce/ci/yaml/ for documentation.
build/x86-64:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
  script:
  - ./.bootstrap &&
    ./configure --disable-static --disable-documentation && make -j4 &&
    NETTLE_TEST_SEED=0 make check -j4 &&
    NETTLE_TEST_SEED=0 make check-fat
  tags:
  - shared
  - linux
  except:
  - tags
build/mini-gmp:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
  script:
  - ./.bootstrap &&
    ./configure --disable-documentation --disable-fat --enable-mini-gmp && make -j4 &&
    make check -j4
  tags:
  - shared
  - linux
  except:
  - tags
build/c89:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
  script:
  - ./.bootstrap &&
    ./configure CC='gcc -std=c89' --disable-static --disable-assembler --disable-documentation && make -j4 &&
    NETTLE_TEST_SEED=0 make check -j4
  tags:
  - shared
  - linux
  except:
  - tags
build/ndebug:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
  script:
  - ./.bootstrap &&
    ./configure CPPFLAGS='-DNDEBUG' --disable-static --disable-assembler --disable-documentation && make -j4 &&
    NETTLE_TEST_SEED=0 make check -j4
  tags:
  - shared
  - linux
  except:
  - tags
build/ubsan:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
  script:
  - ./.bootstrap && 
    CXXFLAGS="-fsanitize=undefined -fno-sanitize-recover -g -O2" CFLAGS="-fsanitize=undefined -fno-sanitize-recover -g -O2" ./configure --disable-assembler 
    --disable-documentation && make -j4 && NETTLE_TEST_SEED=0 make check -j4
  tags:
  - shared
  - linux
  except:
  - tags
build/asan:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
  script:
  - ./.bootstrap && 
  - CXXFLAGS="-fsanitize=address -g -O2" CFLAGS="-fsanitize=address -g -O2" ./configure --disable-documentation --disable-assembler &&
    make -j4 && NETTLE_TEST_SEED=0 make check -j4
  tags:
  - shared
  - linux
  except:
  - tags
build/static-analyzers:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
  script:
  - ./.bootstrap
  - scan-build ./configure --disable-documentation --disable-assembler
  - scan-build --status-bugs -o scan-build-lib make -j$(nproc)
  tags:
  - shared
  - linux
  except:
  - tags
  artifacts:
    expire_in: 1 week
    when: on_failure
    paths:
      - scan-build-lib/*
build/gnutls:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
  script:
  - ./.bootstrap &&
    ./configure --disable-documentation --prefix="$(pwd)/local" --libdir="$(pwd)/local/lib" &&
    make -j4 && make install
  - git clone --depth 1 --branch master https://gitlab.com/gnutls/gnutls.git gnutls-git
  - cd gnutls-git && git submodule update --init && ./bootstrap &&
    ./configure PKG_CONFIG_PATH="$(pwd)/../local/lib/pkgconfig" CPPFLAGS="-I$(pwd)/../local/include"
      LDFLAGS="-L$(pwd)/../local/lib -Wl,-rpath,$(pwd)/../local/lib" --disable-cxx --disable-guile --disable-doc &&
    make -j$(nproc) && make -j $(nproc) check
  tags:
  - shared
  - linux
  except:
  - tags
  artifacts:
    expire_in: 1 week
    when: on_failure
    paths:
      - gnutls-git/guile/tests/*.log
      - gnutls-git/tests/*.log
      - gnutls-git/*.log
      - gnutls-git/tests/*/*.log
      - gnutls-git/tests/suite/*/*.log
Debian.cross.x86:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_X86_CROSS_BUILD
  before_script:
  - apt-get remove -y nettle-dev:i386
  script:
  - build=$(dpkg-architecture -qDEB_HOST_GNU_TYPE)
  - host=i686-linux-gnu
  - export CC_FOR_BUILD="gcc"
  - export CC="$host-gcc"
  - ./.bootstrap &&
    CFLAGS="-O2 -g" ./configure --build=$build --host=$host --disable-documentation && make -j4 &&
    NETTLE_TEST_SEED=0 make check -j4
  tags:
  - shared
  - linux
  except:
  - tags
.Debian.cross.template: &Debian_cross_template
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_CROSS_BUILD
  before_script:
  - host="${CI_JOB_NAME#*.cross.}"
  - dpkg --add-architecture ppc64el
  - dpkg --add-architecture s390x
  - apt-get update -q
  # remove any previously installed nettle headers to avoid conflicts
  - for arch in armhf arm64 ppc64el;do apt-get remove -y nettle-dev:$arch;done
  - if [ "$host" == "powerpc64-linux-gnu" ];then apt-get install -y software-properties-common && add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" && apt-get update && apt-get install -y -t bullseye-backports binfmt-support qemu-user && apt-get install -y gcc-$host g++-$host && export QEMU_LD_PREFIX=/usr/$host EXTRA_CONFIGURE_FLAGS='--enable-mini-gmp';fi
  - if [ "$host" == "powerpc64le-linux-gnu" ];then apt-get install -y software-properties-common && add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" && apt-get update && apt-get install -y -t bullseye-backports binfmt-support qemu-user && apt-get install -y gcc-$host g++-$host libgmp-dev:ppc64el && export QEMU_LD_PREFIX=/usr/$host;fi
  - if [ "$host" == "s390x-linux-gnu" ];then apt-get update && apt-get install -y gcc-$host g++-$host libgmp-dev:s390x && export EXTRA_CONFIGURE_FLAGS='--disable-assembler';fi
  script:
  - build=$(dpkg-architecture -qDEB_HOST_GNU_TYPE)
  - host="${CI_JOB_NAME#*.cross.}"
  # not setting CC_FOR_BUILD paired with qemu-user/binfmt somehow causes
  # config.guess to detect the target as the build platform and not activate
  # cross-compile mode even though --build is given
  - export CC_FOR_BUILD="gcc"
  - export CC="$host-gcc"
  - ./.bootstrap
  - ./configure --disable-static --disable-documentation $EXTRA_CONFIGURE_FLAGS --build=$build --host=$host
  - make -j$(nproc)
  - NETTLE_TEST_SEED=0 make -j$(nproc) check
  - NETTLE_TEST_SEED=0 make -j$(nproc) check-fat
  tags:
  - shared
  - linux
  except:
  - tags
Debian.cross.arm-linux-gnueabihf:
  <<: *Debian_cross_template
Debian.cross.aarch64-linux-gnu:
  <<: *Debian_cross_template
Debian.cross.powerpc64-linux-gnu:
  <<: *Debian_cross_template
Debian.cross.powerpc64le-linux-gnu:
  <<: *Debian_cross_template
Debian.cross.s390x-linux-gnu:
  <<: *Debian_cross_template

remote/s390x:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
  before_script:
  # File created as world-readable by gitlab ci machinery.
  - chmod 0600 $SSH_PRIVATE_KEY
  - ssh -o 'StrictHostKeyChecking no' -i "$SSH_PRIVATE_KEY" "$S390X_ACCOUNT"
    "mkdir -p ci-work/$CI_PIPELINE_IID"
  script:
  - echo $CI_PIPELINE_IID
  - ./.bootstrap &&
    ./configure && make PACKAGE_VERSION=snapshot dist &&
      ls -l *.tar.gz
  - cat nettle-snapshot.tar.gz |
    ssh -o 'StrictHostKeyChecking no' -i "$SSH_PRIVATE_KEY" "$S390X_ACCOUNT"
    "cd ci-work/$CI_PIPELINE_IID && tar xzf -"
  - ssh -o 'StrictHostKeyChecking no' -i "$SSH_PRIVATE_KEY" "$S390X_ACCOUNT"
    "cd ci-work/$CI_PIPELINE_IID/nettle-snapshot && ./configure --disable-documentation --enable-s390x-msa"
  - ssh -o 'StrictHostKeyChecking no' -i "$SSH_PRIVATE_KEY" "$S390X_ACCOUNT"
    "cd ci-work/$CI_PIPELINE_IID/nettle-snapshot && make"
  - ssh -o 'StrictHostKeyChecking no' -i "$SSH_PRIVATE_KEY" "$S390X_ACCOUNT"
    "cd ci-work/$CI_PIPELINE_IID/nettle-snapshot && NETTLE_TEST_SEED=0 make check"
  after_script:
  - ssh -o 'StrictHostKeyChecking no' -i "$SSH_PRIVATE_KEY" "$S390X_ACCOUNT"
    "rm -rf ci-work/$CI_PIPELINE_IID"
  only:
    variables:
    - $SSH_PRIVATE_KEY != ""
    - $S390X_ACCOUNT != ""
  tags:
  - shared
  - linux
  except:
  - tags