Skip to content

Commit 2fc953f

Browse files
committed
ci: update ci
update ci to be similar to master version
1 parent 40741a5 commit 2fc953f

File tree

2 files changed

+45
-30
lines changed

2 files changed

+45
-30
lines changed

.travis.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,32 @@ branches:
88
- master
99
language: rust
1010
os: linux
11-
dist: xenial
11+
dist: focal
1212
addons:
1313
apt:
14+
sources:
15+
- sourceline: "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main"
16+
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
1417
packages:
15-
- llvm-3.8-dev
16-
- libclang-3.8-dev
17-
- clang-3.8
18+
- clang-11
1819
- cmake
1920
rust:
2021
- stable
21-
- beta
22-
- nightly
23-
- nightly-2019-07-01
24-
- nightly-2019-10-28
2522
env:
23+
jobs:
24+
# Matrix build of 3 targets against Rust stable
25+
- TARGET=x86_64-unknown-linux-gnu ZLIB_INSTALLED=true AES_NI_SUPPORT=true
26+
- TARGET=x86_64-fortanix-unknown-sgx
2627
global:
2728
- RUST_BACKTRACE=1
2829
# Pinned to this particular nightly version because of core_io. This can be
2930
# re-pinned whenever core_io is updated to the latest nightly.
30-
- CORE_IO_NIGHTLY=nightly-2019-07-01
31-
- SGX_NIGHTLY=nightly-2019-10-28
32-
- LLVM_CONFIG_PATH=llvm-config-3.8
31+
- CORE_IO_NIGHTLY=nightly-2021-03-25
32+
jobs:
33+
include:
34+
# Test additional Rust toolchains on x86_64
35+
- rust: beta
36+
- rust: nightly
37+
- rust: nightly-2021-03-25
3338
script:
3439
- ./ct.sh

ct.sh

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -ex
33
cd "$(dirname "$0")"
44

@@ -9,30 +9,40 @@ if [ -z $TRAVIS_RUST_VERSION ]; then
99
exit 1
1010
fi
1111

12+
export CFLAGS_x86_64_fortanix_unknown_sgx="-isystem/usr/include/x86_64-linux-gnu -mlvi-hardening -mllvm -x86-experimental-lvi-inline-asm-hardening"
13+
export CC_x86_64_fortanix_unknown_sgx=clang-11
14+
1215
if [ $TRAVIS_RUST_VERSION = "stable" ] || [ $TRAVIS_RUST_VERSION = "beta" ] || [ $TRAVIS_RUST_VERSION = "nightly" ]; then
1316
rustup default $TRAVIS_RUST_VERSION
14-
# make sure that explicitly providing the default target works
15-
cargo test --target x86_64-unknown-linux-gnu
16-
cargo test --release
17-
cargo test --features spin_threading
18-
cargo test --features rust_threading
19-
cargo test --features custom_time,custom_gmtime_r
20-
cargo test --features zlib
21-
cargo test --features pkcs12
22-
cargo test --features pkcs12_rc2
23-
cargo test --features force_aesni_support
24-
cargo test --features dsa
25-
# without these, tests marked with tokio::test do not run, but report OK.
26-
cargo test --features=std,threading,tokio,tokio/net,tokio/io-util,tokio/macros,tokio/rt
17+
rustup target add --toolchain $TRAVIS_RUST_VERSION $TARGET
18+
# The SGX target cannot be run under test like a ELF binary
19+
if [ "$TARGET" != "x86_64-fortanix-unknown-sgx" ]; then
20+
# make sure that explicitly providing the default target works
21+
cargo test --target $TARGET --release
22+
cargo test --features pkcs12 --target $TARGET
23+
cargo test --features pkcs12_rc2 --target $TARGET
24+
cargo test --features dsa --target $TARGET
25+
cargo test --features spin_threading --target $TARGET
26+
cargo test --features rust_threading --target $TARGET
27+
cargo test --features custom_time,custom_gmtime_r --target $TARGET
28+
# without these, tests marked with tokio::test do not run, but report OK.
29+
cargo test --features=std,threading,tokio,tokio/net,tokio/io-util,tokio/macros,tokio/rt --target $TARGET
30+
# If zlib is installed, test the zlib feature
31+
if [ -n "$ZLIB_INSTALLED" ]; then
32+
cargo test --features zlib --target $TARGET
33+
fi
34+
35+
# If AES-NI is supported, test the feature
36+
if [ -n "$AES_NI_SUPPORT" ]; then
37+
cargo test --features force_aesni_support --target $TARGET
38+
fi
39+
else
40+
cargo +$TRAVIS_RUST_VERSION test --no-run --target=$TARGET --features=sgx --no-default-features
41+
fi
2742

2843
elif [ $TRAVIS_RUST_VERSION = $CORE_IO_NIGHTLY ]; then
2944
cargo +$CORE_IO_NIGHTLY test --no-default-features --features core_io,rdrand,time,custom_time,custom_gmtime_r
3045
cargo +$CORE_IO_NIGHTLY test --no-default-features --features core_io,rdrand
31-
32-
elif [ $TRAVIS_RUST_VERSION = $SGX_NIGHTLY ]; then
33-
rustup target add --toolchain $SGX_NIGHTLY x86_64-fortanix-unknown-sgx
34-
cargo +$SGX_NIGHTLY test --no-run --target=x86_64-fortanix-unknown-sgx --features=sgx --no-default-features
35-
3646
else
3747
echo "Unknown version $TRAVIS_RUST_VERSION"
3848
exit 1

0 commit comments

Comments
 (0)