-
Notifications
You must be signed in to change notification settings - Fork 298
Upgrade CI (clippy, more targets) #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+340
−179
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5393b1b
Upgrade CI (clippy, more targets)
gnzlbg c01a29d
Deny warnings on CI
gnzlbg e1e837b
Fix clippy issues
gnzlbg d0afe24
Address feedback
gnzlbg 3805c65
Update minimum supported Rust version to Rust 1.31.0
gnzlbg 244b3c8
Remove use of Self() tuple struct constructors which are unstable in …
gnzlbg 1c6fcb9
arm is not allowed to fail anymore
gnzlbg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1,58 +1,71 @@ | ||
language: rust | ||
sudo: false | ||
rust: nightly | ||
|
||
matrix: | ||
include: | ||
- name: "miri" | ||
rust: nightly | ||
install: | ||
- rustup component add rust-src | ||
- cargo +nightly install --force --git https://github.com/rust-lang/miri miri | ||
- cargo install xargo | ||
script: | ||
- cargo clean | ||
- cargo +nightly miri test | ||
- rust: 1.29.0 | ||
- rust: stable | ||
- rust: beta | ||
- rust: nightly | ||
- rust: nightly | ||
env: | ||
- FEATURES='nightly' | ||
env: TARGET=x86_64-unknown-linux-gnu | ||
script: sh ci/miri.sh | ||
- name: "rustfmt/clippy" | ||
env: TARGET=i586-unknown-linux-gnu | ||
script: sh ci/tools.sh | ||
- name: "docs" | ||
env: TARGET=x86_64-unknown-linux-gnu | ||
script: cargo -vv doc --features nightly,serde,rayon | ||
deploy: | ||
provider: pages | ||
skip-cleanup: true | ||
github-token: $GITHUB_TOKEN | ||
local-dir: target/doc | ||
keep-history: false | ||
on: | ||
branch: master | ||
|
||
# test a target without sse2 for raw/generic.rs | ||
- rust: stable | ||
env: | ||
- TARGET=i586-unknown-linux-gnu | ||
addons: | ||
apt: | ||
packages: | ||
- gcc-multilib | ||
install: | ||
- rustup target add $TARGET | ||
script: | ||
- cargo build --verbose --target $TARGET | ||
- cargo test --verbose --target $TARGET | ||
# Tier 1 targets: | ||
- name: "x86_64-unknown-linux-gnu" | ||
env: TARGET=x86_64-unknown-linux-gnu | ||
- name: "x86_64-unknown-linux-gnu (beta)" | ||
rust: beta | ||
env: TARGET=x86_64-unknown-linux-gnu | ||
- name: "x86_64-unknown-linux-gnu (stable)" | ||
rust: stable | ||
env: TARGET=x86_64-unknown-linux-gnu | ||
- name: "x86_64-unknown-linux-gnu (Rust 1.29.0)" | ||
rust: 1.31.0 | ||
env: TARGET=x86_64-unknown-linux-gnu | ||
- name: "i686-unknown-linux-gnu" | ||
env: TARGET=i686-unknown-linux-gnu CROSS=1 | ||
- name: "x86_64-apple-darwin" | ||
env: TARGET=x86_64-apple-darwin | ||
os: osx | ||
osx_image: xcode10 | ||
- name: "i686-apple-darwin" | ||
env: TARGET=i686-apple-darwin | ||
os: osx | ||
osx_image: xcode10 | ||
- name: "x86_64-pc-windows-msvc" | ||
env: TARGET=x86_64-pc-windows-msvc | ||
os: windows | ||
- name: "x86_64-pc-windows-gnu" | ||
env: TARGET=x86_64-pc-windows-gnu CROSS=1 | ||
- name: "i686-pc-windows-gnu" | ||
env: TARGET=i686-pc-windows-gnu CROSS=1 | ||
|
||
# Tier 2/3 targets: | ||
- name: "i586-unknown-linux-gnu (no SSE2)" | ||
env: TARGET=i586-unknown-linux-gnu CROSS=1 | ||
- name: "armv7-unknown-linux-gnueabihf" | ||
env: TARGET=armv7-unknown-linux-gnueabihf CROSS=1 | ||
- name: "aarch64-unknown-linux-gnu" | ||
env: TARGET=aarch64-unknown-linux-gnu CROSS=1 | ||
|
||
install: travis_retry rustup target add "${TARGET}" | ||
script: sh ci/run.sh | ||
|
||
branches: | ||
# Don't build these branches | ||
except: | ||
# Used by bors | ||
- trying.tmp | ||
- staging.tmp | ||
|
||
before_script: | ||
- if [ "$TRAVIS_RUST_VERSION" == "stable" ]; then rustup component add rustfmt; fi | ||
|
||
script: | ||
- if [ "$TRAVIS_RUST_VERSION" == "stable" ]; then cargo fmt -- --check; fi | ||
|
||
- cargo build --verbose --features "$FEATURES" | ||
- cargo test --verbose --features "$FEATURES" | ||
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo bench --verbose --features "$FEATURES"; fi | ||
- cargo doc --verbose --features "$FEATURES" | ||
|
||
- cargo build --verbose --features "$FEATURES serde" | ||
- cargo test --verbose --features "$FEATURES serde" | ||
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo bench --verbose --features "$FEATURES serde"; fi | ||
- cargo doc --verbose --features "$FEATURES serde" |
This file contains hidden or 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 |
---|---|---|
|
@@ -26,4 +26,5 @@ rustc-hash = "1.0" | |
serde_test = "1.0" | ||
|
||
[features] | ||
default = [] | ||
nightly = [] |
This file contains hidden or 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,11 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -ex | ||
|
||
export CARGO_NET_RETRY=5 | ||
export CARGO_NET_TIMEOUT=10 | ||
|
||
if cargo install --force --git https://github.com/rust-lang/miri miri ; then | ||
cargo miri setup | ||
cargo miri test | ||
fi |
This file contains hidden or 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,38 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -ex | ||
|
||
: "${TARGET?The TARGET environment variable must be set.}" | ||
|
||
FEATURES="rayon,serde" | ||
if [ "${TRAVIS_RUST_VERSION}" = "nightly" ]; then | ||
FEATURES="${FEATURES},nightly" | ||
export RUSTFLAGS="$RUSTFLAGS -D warnings" | ||
fi | ||
|
||
CARGO=cargo | ||
if [ "${CROSS}" = "1" ]; then | ||
export CARGO_NET_RETRY=5 | ||
export CARGO_NET_TIMEOUT=10 | ||
|
||
cargo install cross | ||
CARGO=cross | ||
fi | ||
|
||
export RUSTFLAGS="$RUSTFLAGS --cfg hashbrown_deny_warnings" | ||
|
||
"${CARGO}" -vv test --target="${TARGET}" | ||
"${CARGO}" -vv test --target="${TARGET}" --features "${FEATURES}" | ||
|
||
"${CARGO}" -vv test --target="${TARGET}" --release | ||
"${CARGO}" -vv test --target="${TARGET}" --release --features "${FEATURES}" | ||
|
||
if [ "${TRAVIS_RUST_VERSION}" = "nightly" ]; then | ||
# Run benchmark on native targets, build them on non-native ones: | ||
NO_RUN="" | ||
if [ "${CROSS}" = "1" ]; then | ||
NO_RUN="--no-run" | ||
fi | ||
|
||
"${CARGO}" -vv bench "${NO_RUN}" --features "${FEATURES}" | ||
fi |
This file contains hidden or 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,45 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -ex | ||
|
||
retry() { | ||
result=0 | ||
count=1 | ||
max=5 | ||
while [ "$count" -le 3 ]; do | ||
[ "$result" -ne 0 ] && { | ||
printf "\nRetrying, %d of %d\n" $count $max >&2 | ||
} | ||
"$@" | ||
result=$? | ||
[ $result -eq 0 ] && break | ||
count=$(count + 1) | ||
sleep 1 | ||
done | ||
|
||
[ "$count" -gt 3 ] && { | ||
printf "\nFailed %d times.\n" $max >&2 | ||
} | ||
|
||
return $result | ||
} | ||
|
||
|
||
if retry rustup component add rustfmt ; then | ||
cargo fmt --all -- --check | ||
fi | ||
|
||
if retry rustup component add clippy ; then | ||
cargo clippy --all -- -D clippy::pedantic | ||
fi | ||
|
||
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then | ||
if retry rustup component add clippy ; then | ||
cargo clippy --all --target=i586-unknown-linux-gnu -- -D clippy::pedantic | ||
fi | ||
fi | ||
|
||
if command -v shellcheck ; then | ||
shellcheck --version | ||
shellcheck ci/*.sh | ||
fi |
This file contains hidden or 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 @@ | ||
doc-valid-idents = [ "CppCon", "SwissTable", "SipHash", "HashDoS" ] |
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if you are interested into deploying the docs with the nightly features to github-pages. If not I can just remove the
deploy
key. Otherwise, you'd need to generate a token and push it to travis asGITHUB_TOKEN
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only difference is that
HashMap::new
is const fn on nightly. Not worth a completely separate set of docs IMO.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the serde and rayon features would add more stuff. I'll remove the deploy key then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I forgot about those! Yes, please do keep the docs in that case.