Unverified Commit 0f3d38f9 authored by yiwu-arbug's avatar yiwu-arbug Committed by GitHub

update CI (#642)

Changes:
1. Since travis-ci.org is terminated, we are moving CI of this repo to PingCAP internal jenkins CI. Removing all travis related scripts.
2. remove `./rust-toolchain` file, and `Make build` will download the file from latest TiKV master, so we can keep in sync with TiKV.
3. fixing flaky test_auto_roll_max_size_info_log. In the background rocksdb can trigger log rotation. If log rotates exactly when the test check for LOG file existence, the check can fail. Removing the check.
Signed-off-by: 's avatarYi Wu <yiwu@pingcap.com>
parent 9ff54e09
*.swo *.swo
*.swp *.swp
target
Cargo.lock
*.orig *.orig
*.bk *.bk
_rust_rocksdb* _rust_rocksdb*
...@@ -12,3 +10,7 @@ tags ...@@ -12,3 +10,7 @@ tags
out/ out/
*.iml *.iml
.vscode .vscode
target
Cargo.lock
rust-toolchain
dist: bionic
language: rust
rust:
- nightly
addons:
apt:
sources:
- llvm-toolchain-bionic-7
packages:
- clang-format-7
jobs:
include:
- os: linux
rust: nightly
env: FEATURES="encryption,jemalloc,portable,sse"
- os: linux
arch: arm64-graviton2
rust: nightly
- os: osx
osx_image: xcode11.5
rust: nightly
- env: TASK="clang-format"
env:
global:
- RUST_BACKTRACE=1
before_script:
- rustup component add rustfmt-preview
- rustup component add clippy
script:
# compiling rocksdb may cost more than 10 minutes, see https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received
- if [ "${TASK}" == "clang-format" ]; then
bash ./travis-build/travis-format.sh;
else
travis_wait make clippy;
cargo fmt --all -- --check;
cargo build --features=$FEATURES;
cargo test --all --features=$FEATURES;
fi
all: format build test all: format build test
format: prepare:
curl https://raw.githubusercontent.com/tikv/tikv/master/rust-toolchain > rust-toolchain
format: prepare
@cargo fmt --all @cargo fmt --all
@scripts/format-diff.sh @scripts/format-diff.sh
build: build: prepare
@cargo build @cargo build
test: test: prepare
@export RUST_BACKTRACE=1 && cargo test -- --nocapture @export RUST_BACKTRACE=1 && cargo test -- --nocapture
clean: clean:
...@@ -15,7 +18,7 @@ clean: ...@@ -15,7 +18,7 @@ clean:
@cd librocksdb_sys && cargo clean @cd librocksdb_sys && cargo clean
# TODO it could be worth fixing some of these lints # TODO it could be worth fixing some of these lints
clippy: clippy: prepare
@cargo clippy --all -- \ @cargo clippy --all -- \
-D warnings \ -D warnings \
-A clippy::redundant_field_names -A clippy::single_match \ -A clippy::redundant_field_names -A clippy::single_match \
......
nightly-2021-01-25
...@@ -293,8 +293,6 @@ fn test_auto_roll_max_size_info_log() { ...@@ -293,8 +293,6 @@ fn test_auto_roll_max_size_info_log() {
.unwrap(); .unwrap();
let db = DB::open(opts, path.path().to_str().unwrap()).unwrap(); let db = DB::open(opts, path.path().to_str().unwrap()).unwrap();
assert!(Path::new(info_dir.path().join("LOG").to_str().unwrap()).is_file());
drop(db); drop(db);
// The LOG must be rolled many times. // The LOG must be rolled many times.
......
prepare-rustfmt:
@[[ "`cargo fmt -- --version`" = "0.2.1-nightly ( )" ]] || cargo install --vers 0.2.1 --force rustfmt-nightly || exit 0
\ No newline at end of file
#!/bin/bash
set -ev
git fetch --depth=1 origin master:master;
git diff $(git merge-base master HEAD) HEAD ./librocksdb_sys/crocksdb > diff;
cat diff | clang-format-diff-7 -style=google -p1 > formatted;
if [ -s formatted ]; then
cat formatted;
echo "Run \`scripts/format-diff.sh\` to format your code.";
exit 1;
fi;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment