-
Notifications
You must be signed in to change notification settings - Fork 34
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
ci: Migrate Rust to cimg/rust, cache cargo #717
Merged
Changes from all commits
Commits
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 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 |
---|---|---|
|
@@ -15,6 +15,9 @@ executors: | |
macos: | ||
macos: | ||
xcode: 11.6.0 | ||
rust: | ||
docker: | ||
- image: cimg/rust:1.49 | ||
|
||
commands: | ||
install_macos_deps: | ||
|
@@ -35,7 +38,7 @@ commands: | |
else | ||
[[ $OSTYPE = darwin* ]] && os=macos || os=ubuntu | ||
cd /usr/local | ||
curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.20/wabt-1.0.20-$os.tar.gz | (sudo tar xz --strip 1 || tar xz --strip 1) | ||
curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.20/wabt-1.0.20-$os.tar.gz | sudo tar xz --strip 1 | ||
fi | ||
|
||
install_testfloat: | ||
|
@@ -265,6 +268,39 @@ commands: | |
echo $result | ||
if [ "$expected" != "$result" ]; then exit 1; fi | ||
|
||
rust_restore_cargo_cache: | ||
steps: | ||
- restore_cache: | ||
name: "Restore cargo cache" | ||
key: cargo- | ||
|
||
rust_save_cargo_cache: | ||
steps: | ||
- save_cache: | ||
name: "Save cargo cache" | ||
key: cargo-{{checksum "Cargo.lock"}} | ||
paths: | ||
- ~/.cargo | ||
|
||
rust_install_system_dependencies: | ||
steps: | ||
- run: | ||
name: "Install system build dependencies" | ||
command: | | ||
sudo apt-get -q update | ||
sudo apt-get -qy install cmake --no-install-recommends | ||
sudo apt-get -qy install llvm-10-dev clang-10 --no-install-recommends | ||
|
||
rust_install_nightly: | ||
steps: | ||
- run: | ||
name: "Install nightly toolchain" | ||
command: | | ||
rustup toolchain install nightly-x86_64-unknown-linux-gnu | ||
rustup component add llvm-tools-preview | ||
cargo install cargo-binutils rustfilt | ||
|
||
|
||
jobs: | ||
|
||
lint: | ||
|
@@ -585,18 +621,11 @@ jobs: | |
objects: fizzy-spectests | ||
|
||
bindings-rust: | ||
docker: | ||
- image: rust:1-buster | ||
executor: rust | ||
steps: | ||
- rust_restore_cargo_cache | ||
- rust_install_system_dependencies | ||
- checkout | ||
- run: | ||
name: Update environment | ||
command: | | ||
echo 'deb http://deb.debian.org/debian buster-backports main' >> /etc/apt/sources.list | ||
apt -qq update | ||
apt -yq -t buster-backports install cmake --no-install-recommends | ||
apt -yq install libclang-dev clang cmake --no-install-recommends | ||
rustup component add rustfmt | ||
- run: | ||
name: Check formatting | ||
command: | | ||
|
@@ -623,20 +652,15 @@ jobs: | |
# The package must be run within the actual crate and not in the workspace. | ||
working_directory: bindings/rust | ||
command: cargo package | ||
- rust_save_cargo_cache | ||
|
||
bindings-rust-asan: | ||
docker: | ||
- image: rust:1-buster | ||
executor: rust | ||
steps: | ||
- rust_restore_cargo_cache | ||
- rust_install_system_dependencies | ||
- rust_install_nightly | ||
- checkout | ||
- run: | ||
name: Update environment | ||
command: | | ||
echo 'deb http://deb.debian.org/debian buster-backports main' >> /etc/apt/sources.list | ||
apt -qq update | ||
apt -yq -t buster-backports install cmake --no-install-recommends | ||
apt -yq install llvm-8-dev clang-8 --no-install-recommends | ||
rustup toolchain install nightly-x86_64-unknown-linux-gnu | ||
- run: | ||
name: Build (debug mode) | ||
command: RUSTFLAGS="-Z sanitizer=address" cargo +nightly build --target x86_64-unknown-linux-gnu | ||
|
@@ -645,26 +669,19 @@ jobs: | |
command: RUSTFLAGS="-Z sanitizer=address -C opt-level=0" cargo +nightly test --target x86_64-unknown-linux-gnu | ||
|
||
bindings-rust-coverage: | ||
docker: | ||
- image: rust:1-buster | ||
executor: rust | ||
steps: | ||
- rust_restore_cargo_cache | ||
- rust_install_system_dependencies | ||
- rust_install_nightly | ||
- checkout | ||
- run: | ||
name: Update environment | ||
command: | | ||
echo 'deb http://deb.debian.org/debian buster-backports main' >> /etc/apt/sources.list | ||
apt -qq update | ||
apt -yq -t buster-backports install cmake --no-install-recommends | ||
apt -yq install llvm-8-dev clang-8 --no-install-recommends | ||
rustup toolchain install nightly-x86_64-unknown-linux-gnu | ||
rustup component add llvm-tools-preview | ||
cargo install cargo-binutils rustfilt | ||
- run: | ||
name: Build (debug mode) | ||
command: RUSTFLAGS="-Z instrument-coverage" cargo +nightly build --target x86_64-unknown-linux-gnu | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think |
||
- run: | ||
name: Test (debug mode) | ||
command: RUSTFLAGS="-Z instrument-coverage -C opt-level=0" LLVM_PROFILE_FILE="fizzy-%m.profraw" cargo +nightly test --target x86_64-unknown-linux-gnu | ||
- rust_save_cargo_cache | ||
- run: | ||
name: Collect coverage data (Rust) | ||
command: | | ||
|
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.
Does this mean it will pick up anything? Latest?
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.
It suppose to download the latest matching this prefix. We cannot match with Cargo.lock because it does not exist here.