@@ -3,31 +3,51 @@ cargo_cache:
3
3
fingerprint_script : cat Cargo.lock || echo ""
4
4
5
5
env :
6
+ # Build by default; don't just check
7
+ BUILD : build
6
8
RUSTFLAGS : -D warnings
7
9
RUSTDOCFLAGS : -D warnings
10
+ TOOL : cargo
11
+ # The MSRV
12
+ TOOLCHAIN : 1.46.0
13
+
14
+ # Tests that don't require executing the build binaries
15
+ build : &BUILD
16
+ build_script :
17
+ - . $HOME/.cargo/env || true
18
+ - $TOOL +$TOOLCHAIN $BUILD --target $TARGET --all-targets
19
+ - $TOOL +$TOOLCHAIN doc --no-deps --target $TARGET
20
+
21
+ # Tests that do require executing the binaries
22
+ test : &TEST
23
+ << : *BUILD
24
+ test_script :
25
+ - . $HOME/.cargo/env || true
26
+ - $TOOL +$TOOLCHAIN test --target $TARGET
27
+
8
28
# Test FreeBSD in a full VM. Test the i686 target too, in the
9
29
# same VM. The binary will be built in 32-bit mode, but will execute on a
10
30
# 64-bit kernel and in a 64-bit environment. Our tests don't execute any of
11
31
# the system's binaries, so the environment shouldn't matter.
12
32
task :
13
33
name : FreeBSD amd64 & i686
34
+ env :
35
+ TARGET : x86_64-unknown-freebsd
14
36
freebsd_instance :
15
37
image : freebsd-11-4-release-amd64
16
38
setup_script :
17
39
- fetch https://sh.rustup.rs -o rustup.sh
18
- - sh rustup.sh -y --profile=minimal --default-toolchain 1.46.0
40
+ - sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
19
41
- $HOME/.cargo/bin/rustup target add i686-unknown-freebsd
20
- amd64_test_script :
21
- - . $HOME/.cargo/env
22
- - cargo test
23
- - cargo doc --no-deps
42
+ << : *TEST
24
43
i386_test_script :
25
44
- . $HOME/.cargo/env
26
- - cargo test --target i686-unknown-freebsd
45
+ - cargo build --target i686-unknown-freebsd
27
46
- cargo doc --no-deps --target i686-unknown-freebsd
47
+ - cargo test --target i686-unknown-freebsd
28
48
before_cache_script : rm -rf $CARGO_HOME/registry/index
29
49
30
- # Test OSX and iOS in a full VM
50
+ # Test OSX in a full VM
31
51
task :
32
52
matrix :
33
53
- name : OSX x86_64
37
57
image : catalina-xcode
38
58
setup_script :
39
59
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
40
- - sh rustup.sh -y --profile=minimal --default-toolchain 1.46.0
60
+ - sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
41
61
- . $HOME/.cargo/env
42
- - cargo install cross
43
- script :
44
- - . $HOME/.cargo/env
45
- - cross build --target $TARGET
46
- - cross test --target $TARGET
62
+ << : *TEST
47
63
before_cache_script : rm -rf $CARGO_HOME/registry/index
48
64
49
65
# Use cross for QEMU-based testing
54
70
HOME : /tmp/home
55
71
PATH : $HOME/.cargo/bin:$PATH
56
72
RUSTFLAGS : --cfg qemu -D warnings
73
+ TOOL : cross
57
74
matrix :
58
75
- name : Linux arm gnueabi
59
76
env :
@@ -91,14 +108,10 @@ task:
91
108
setup_script :
92
109
- mkdir /tmp/home
93
110
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
94
- - sh rustup.sh -y --profile=minimal --default-toolchain 1.46.0
111
+ - sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
95
112
- . $HOME/.cargo/env
96
113
- cargo install cross
97
- script :
98
- - . $HOME/.cargo/env || true
99
- - cross build --target $TARGET
100
- - cross test --target $TARGET
101
- - cross doc --no-deps --target $TARGET
114
+ << : *TEST
102
115
before_cache_script : rm -rf $CARGO_HOME/registry/index
103
116
104
117
# Tasks for Linux native builds
@@ -109,6 +122,7 @@ task:
109
122
image : rust:latest
110
123
env :
111
124
TARGET : x86_64-unknown-linux-gnu
125
+ TOOLCHAIN :
112
126
- name : Linux aarch64
113
127
arm_container :
114
128
image : rust:1.46
@@ -127,19 +141,15 @@ task:
127
141
TARGET : x86_64-unknown-linux-musl
128
142
setup_script :
129
143
- rustup target add $TARGET
130
- - uname -a
131
- script :
132
- - cargo build --target $TARGET --all-targets
133
- - cargo test --target $TARGET
134
- - cargo doc --no-deps --target $TARGET
144
+ << : *TEST
135
145
before_cache_script : rm -rf $CARGO_HOME/registry/index
136
146
137
147
# Tasks for cross-compiling, but no testing
138
148
task :
139
149
container :
140
150
image : rust:1.46
141
151
env :
142
- TOOLCHAIN : 1.46.0
152
+ BUILD : check
143
153
matrix :
144
154
# Cross claims to support Android, but when it tries to run Nix's tests it
145
155
# reports undefined symbol references.
@@ -178,8 +188,7 @@ task:
178
188
TARGET : aarch64-apple-ios
179
189
# Rustup only supports cross-building from arbitrary hosts for iOS at
180
190
# 1.49.0 and above. Below that it's possible to cross-build from an OSX
181
- # host, but OSX VMs
182
- # are more expensive than Linux VMs.
191
+ # host, but OSX VMs are more expensive than Linux VMs.
183
192
TOOLCHAIN : 1.49.0
184
193
- name : iOS x86_64
185
194
env :
@@ -214,17 +223,16 @@ task:
214
223
setup_script :
215
224
- rustup target add $TARGET
216
225
- rustup toolchain install $TOOLCHAIN --profile minimal --target $TARGET
217
- script :
218
- - cargo +$TOOLCHAIN check --target $TARGET
219
- - cargo +$TOOLCHAIN check --all-targets --target $TARGET
220
- - cargo +$TOOLCHAIN doc --no-deps --target $TARGET
226
+ << : *BUILD
221
227
before_cache_script : rm -rf $CARGO_HOME/registry/index
222
228
223
229
# Test that we can build with the lowest version of all dependencies.
224
230
# "cargo test" doesn't work because some of our dev-dependencies, like
225
231
# rand, can't build with their own minimal dependencies.
226
232
task :
227
233
name : Minver
234
+ env :
235
+ TOOLCHAIN : nightly
228
236
container :
229
237
image : rustlang/rust:nightly
230
238
setup_script :
0 commit comments