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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# Copyright © 2016–2023 Trevor Spiteri
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
variables:
MSRV: 1.65.0
stages:
- clibs
- test
before_script:
- getconf LONG_BIT
- rustup self update
- rustup --version
- if [ -n "$TOOLCHAIN" ]; then rustup toolchain install --profile minimal $TOOLCHAIN; fi
- if [ -d cargo/registry/cache ]; then rm -rf $CARGO_HOME/registry/cache && mkdir -p $CARGO_HOME/registry && cp -R cargo/registry/cache $CARGO_HOME/registry/ && echo Copied registry/cache; fi
- (if cd $CARGO_HOME/registry && [ -d src ]; then rm -r src; fi)
- (if cd $CARGO_HOME/registry && [ -d cache ]; then find cache -name \*.crate | sort; fi)
- export GMP_MPFR_SYS_CACHE=$CI_PROJECT_DIR/gmp-mpfr-sys-cache
after_script:
- (if cd $CARGO_HOME/registry && [ -d cache ]; then for c in cache/*/*.crate; do s=src/${c#cache/}; if [ ! -e ${s%.crate} ]; then rm -v $c; fi; done; find cache -name \*.crate | sort; fi)
- rm -rf cargo
- mkdir -p cargo/registry
- cp -R $CARGO_HOME/registry/cache cargo/registry/ && echo Updated registry/cache
clibs-x86_64-gnulinux:
image: amd64/rust:1
stage: clibs
variables:
TOOLCHAIN: beta-x86_64
cache:
key: $CI_JOB_NAME
paths:
- cargo/
- gmp-mpfr-sys-cache/
script:
- cargo +$TOOLCHAIN fetch
- cargo +$TOOLCHAIN test -p gmp-mpfr-sys
artifacts:
paths:
- cargo/
- gmp-mpfr-sys-cache/
expire_in: 1 day
only:
- ci
- www
beta-x86_64-gnulinux:
image: amd64/rust:1
stage: test
dependencies:
- clibs-x86_64-gnulinux
variables:
TOOLCHAIN: beta-x86_64
script:
- etc/test.sh
only:
- ci
msrv-x86_64-gnulinux:
image: amd64/rust:1
stage: test
dependencies:
- clibs-x86_64-gnulinux
variables:
TOOLCHAIN: $MSRV-x86_64
script:
- etc/test.sh
only:
- ci
stable-x86_64-gnulinux-tarpaulin:
image: amd64/rust:1
stage: test
cache:
key: $CI_JOB_NAME
paths:
- cargo/
dependencies:
- clibs-x86_64-gnulinux
variables:
TOOLCHAIN: stable-x86_64
REQ_COVERAGE: "79.0"
script:
- cargo install --version 0.26.1 --locked cargo-tarpaulin
- etc/extract-doc-tests.sh
- stdbuf -oL etc/invoke-tarpaulin.sh | tee tarpaulin.log
- etc/extract-doc-tests.sh restore
- echo "Check that coverage not less than $REQ_COVERAGE%"
- tail -1 tarpaulin.log | awk '{ if ($1 < '$REQ_COVERAGE') { exit 1 } }'
only:
- ci
stable-x86_64-gnulinux-valgrind:
image: amd64/rust:1
stage: test
dependencies:
- clibs-x86_64-gnulinux
variables:
TOOLCHAIN: stable-x86_64
VALGRIND_OPTIONS: --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all --track-origins=yes --error-exitcode=1 --gen-suppressions=all --suppressions=etc/test_main_static.supp
RUSTFLAGS: -g
script:
- apt-get update -qq && apt-get install -y -qq valgrind
- etc/extract-doc-tests.sh
- cargo +$TOOLCHAIN test --features "num-traits serde" --lib
- valgrind $VALGRIND_OPTIONS "$(ls target/debug/deps/rug* | grep -v '\.d')"
- cargo +$TOOLCHAIN test --release --features "num-traits serde" --lib
- valgrind $VALGRIND_OPTIONS "$(ls target/release/deps/rug* | grep -v '\.d')"
- etc/extract-doc-tests.sh restore
only:
- ci
beta-x86_64-gnulinux-tidy:
image: amd64/rust:1
stage: test
dependencies:
- clibs-x86_64-gnulinux
variables:
TOOLCHAIN: beta-x86_64
script:
- rustup component add --toolchain $TOOLCHAIN rustfmt clippy
- etc/tidy.sh
only:
- ci
clibs-i686-gnulinux:
image: i386/rust:1
stage: clibs
variables:
TOOLCHAIN: beta-i686
cache:
key: $CI_JOB_NAME
paths:
- cargo/
- gmp-mpfr-sys-cache/
script:
- cargo +$TOOLCHAIN fetch
- cargo +$TOOLCHAIN test -p gmp-mpfr-sys
artifacts:
paths:
- cargo/
- gmp-mpfr-sys-cache/
expire_in: 1 day
only:
- ci
beta-i686-gnulinux:
image: i386/rust:1
stage: test
dependencies:
- clibs-i686-gnulinux
variables:
TOOLCHAIN: beta-i686
script:
- etc/test.sh
only:
- ci
msrv-i686-gnulinux:
image: i386/rust:1
stage: test
dependencies:
- clibs-i686-gnulinux
variables:
TOOLCHAIN: $MSRV-i686
script:
- etc/test.sh
only:
- ci
stable-i686-gnulinux-valgrind:
image: i386/rust:1
stage: test
dependencies:
- clibs-i686-gnulinux
variables:
TOOLCHAIN: stable-i686
VALGRIND_OPTIONS: --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all --track-origins=yes --error-exitcode=1 --gen-suppressions=all --suppressions=etc/test_main_static.supp
RUSTFLAGS: -g
script:
- apt-get update -qq && apt-get install -y -qq valgrind
- etc/extract-doc-tests.sh
- cargo +$TOOLCHAIN test --features "num-traits serde" --lib
- valgrind $VALGRIND_OPTIONS "$(ls target/debug/deps/rug* | grep -v '\.d')"
- cargo +$TOOLCHAIN test --release --features "num-traits serde" --lib
- valgrind $VALGRIND_OPTIONS "$(ls target/release/deps/rug* | grep -v '\.d')"
- etc/extract-doc-tests.sh restore
only:
- ci
beta-i686-gnulinux-tidy:
image: i386/rust:1
stage: test
dependencies:
- clibs-i686-gnulinux
variables:
TOOLCHAIN: beta-i686
script:
- rustup component add --toolchain $TOOLCHAIN rustfmt clippy
- etc/tidy.sh
only:
- ci
pages:
image: amd64/rust:1
stage: test
cache:
key: $CI_JOB_NAME
paths:
- cargo/
dependencies:
- clibs-x86_64-gnulinux
variables:
TOOLCHAIN: nightly-x86_64
script:
- rm -rf public
- mkdir public
- cp etc/{index.html,rug.svg} public
- cargo +$TOOLCHAIN doc --no-deps --features "num-traits serde" -Z rustdoc-map
- mv target/doc public/dev
artifacts:
paths:
- public
only:
- www