forked from nervosnetwork/muta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
language: rust | ||
sudo: true | ||
cache: | ||
cargo: true | ||
timeout: 1024 | ||
|
||
git: | ||
depth: 2 | ||
submodules: false | ||
|
||
if: 'branch IN (master, develop, staging, trying) OR type != push OR fork = true OR tag =~ ^v' | ||
|
||
env: | ||
global: | ||
- RUST_BACKTRACE=full | ||
|
||
matrix: | ||
include: | ||
- rust: 1.33.0 | ||
os: osx | ||
env: FMT=true CHECK=true TEST=true | ||
- rust: 1.33.0 | ||
os: linux | ||
env: FMT=true CHECK=true TEST=true | ||
|
||
install: ./devtools/ci/install.sh | ||
script: ./devtools/ci/script.sh | ||
|
||
before_cache: | ||
- rm -rf ./target/debug/incremental/ | ||
- cargo sweep -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
VERBOSE := $(if ${CI},--verbose,) | ||
|
||
test: | ||
cargo test ${VERBOSE} --all -- --nocapture | ||
|
||
doc: | ||
cargo doc --all --no-deps | ||
|
||
doc-deps: | ||
cargo doc --all | ||
|
||
check: | ||
cargo check ${VERBOSE} --all | ||
|
||
build: | ||
cargo build ${VERBOSE} --release | ||
|
||
prod: | ||
cargo build ${VERBOSE} --release | ||
|
||
prod-test: | ||
cargo test ${VERBOSE} --all -- --nocapture | ||
|
||
fmt: | ||
cargo fmt ${VERBOSE} --all -- --check | ||
|
||
clippy: | ||
cargo clippy ${VERBOSE} --all --all-targets --all-features -- -D warnings -D clippy::clone_on_ref_ptr -D clippy::enum_glob_use | ||
|
||
|
||
ci: fmt clippy test | ||
git diff --exit-code Cargo.lock | ||
|
||
info: | ||
date | ||
pwd | ||
env | ||
|
||
# For counting lines of code | ||
stats: | ||
@cargo count --version || cargo +nightly install --git https://github.com/kbknapp/cargo-count | ||
@cargo count --separator , --unsafe-statistics | ||
|
||
# Use cargo-audit to audit Cargo.lock for crates with security vulnerabilities | ||
# expecting to see "Success No vulnerable packages found" | ||
security-audit: | ||
@cargo audit --version || cargo install cargo-audit | ||
@cargo audit | ||
|
||
.PHONY: build prod prod-test | ||
.PHONY: fmt test clippy doc doc-deps check stats | ||
.PHONY: ci info security-audit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
set -ev | ||
|
||
cargo sweep --version || cargo install --git https://github.com/holmgr/cargo-sweep --rev 3e98dbf7e4ddf1e07dd2526a803c501fd549da75 | ||
|
||
if [ "$FMT" = true ]; then | ||
cargo fmt --version || rustup component add rustfmt | ||
fi | ||
|
||
if [ "$CHECK" = true ]; then | ||
cargo clippy --version || rustup component add clippy | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -ev | ||
|
||
cargo sweep -s | ||
|
||
if [ "$FMT" = true ]; then | ||
make fmt | ||
fi | ||
if [ "$CHECK" = true ]; then | ||
make check | ||
make clippy | ||
fi | ||
if [ "$TEST" = true ]; then | ||
make test | ||
fi | ||
|
||
git diff --exit-code Cargo.lock |