Skip to content

Commit dd019cc

Browse files
authored
minor: add compile tests for min stable version and nightly (#227)
1 parent b025aaa commit dd019cc

File tree

5 files changed

+66
-0
lines changed

5 files changed

+66
-0
lines changed

.evergreen/compile-only-async-std.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
set -o errexit
4+
5+
. ~/.cargo/env
6+
7+
rustup run $RUST_VERSION cargo build --no-default-features --features async-std-runtime
8+
rustup run $RUST_VERSION cargo build --no-default-features --features sync

.evergreen/compile-only-tokio.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
set -o errexit
4+
5+
. ~/.cargo/env
6+
7+
rustup run $RUST_VERSION cargo build

.evergreen/compile-only.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
set -o errexit
4+
5+
. ~/.cargo/env
6+
rustup update $RUST_VERSION
7+
8+
if [ "$ASYNC_RUNTIME" = "tokio" ]; then
9+
.evergreen/compile-only-tokio.sh
10+
elif [ "$ASYNC_RUNTIME" = "async-std" ]; then
11+
.evergreen/compile-only-async-std.sh
12+
else
13+
echo "invalid async runtime: ${ASYNC_RUNTIME}" >&2
14+
exit 1
15+
fi

.evergreen/config.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,16 @@ functions:
339339
export MONGO_ATLAS_FREE_TIER_REPL_URI_SRV='${MONGO_ATLAS_FREE_TIER_REPL_URI_SRV}'
340340
ASYNC_RUNTIME=${ASYNC_RUNTIME} .evergreen/run-atlas-tests.sh
341341
342+
"compile only":
343+
- command: shell.exec
344+
type: test
345+
params:
346+
shell: bash
347+
working_dir: "src"
348+
script: |
349+
${PREPARE_SHELL}
350+
ASYNC_RUNTIME=${ASYNC_RUNTIME} RUST_VERSION=${RUST_VERSION} .evergreen/compile-only.sh
351+
342352
"check rustfmt":
343353
- command: shell.exec
344354
type: test
@@ -629,6 +639,10 @@ tasks:
629639
commands:
630640
- func: "run atlas tests"
631641

642+
- name: "compile-only"
643+
commands:
644+
- func: "compile only"
645+
632646
- name: "check-rustfmt"
633647
commands:
634648
- func: "check rustfmt"
@@ -640,6 +654,16 @@ tasks:
640654

641655

642656
axes:
657+
- id: "extra-rust-versions"
658+
values:
659+
- id: "min"
660+
display_name: "1.43 (minimum supported version)"
661+
variables:
662+
RUST_VERSION: "1.43.1"
663+
- id: "nightly"
664+
display_name: "nightly"
665+
variables:
666+
RUST_VERSION: "nightly"
643667
- id: "mongodb-version"
644668
display_name: MongoDB Version
645669
values:
@@ -757,6 +781,15 @@ buildvariants:
757781
display_name: "AWS Auth ${os} with ${async-runtime}"
758782
tasks:
759783
- ".aws-auth"
784+
- matrix_name: "compile-only"
785+
matrix_spec:
786+
os:
787+
- ubuntu-18.04
788+
async-runtime: "*"
789+
extra-rust-versions: "*"
790+
display_name: "Compile on Rust ${extra-rust-versions} with ${async-runtime}"
791+
tasks:
792+
- "compile-only"
760793

761794
-
762795
name: "lint"

.evergreen/install-dependencies.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ fi
1818
echo 'export PATH=$PATH:~/.cargo/bin' >> ~/.cargo/env
1919

2020
echo "export CARGO_NET_GIT_FETCH_WITH_CLI=true" >> ~/.cargo/env
21+
2122
. ~/.cargo/env
23+
24+
# Install nightly rustfmt
2225
rustup toolchain install nightly -c rustfmt

0 commit comments

Comments
 (0)