From 56035910106ce5315f1d7affea26598bfdd79e4c Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 30 Sep 2020 18:45:34 +0100 Subject: [PATCH] ci: add rust bindings --- circle.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/circle.yml b/circle.yml index d225124989..1fc42cd8df 100644 --- a/circle.yml +++ b/circle.yml @@ -512,6 +512,53 @@ jobs: - spectest - collect_coverage_data + bindings-rust: + docker: + - image: rust:1-buster + steps: + - 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 + rustup update + - run: + name: Check formatting + command: | + rustfmt --version + cargo fmt --all -- --check + - run: + name: Build + command: cargo build + - run: + name: Test + command: cargo test + + bindings-rust-asan: + docker: + - image: rust:1-buster + steps: + - 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 update + - run: + name: Build + command: RUSTFLAGS="-Z sanitizer=address" ASAN_OPTIONS=detect_leaks=1 cargo +nightly build --target x86_64-unknown-linux-gnu + - run: + name: Test + command: RUSTFLAGS="-Z sanitizer=address -C opt-level=0" ASAN_OPTIONS=detect_leaks=1 cargo +nightly test --target x86_64-unknown-linux-gnu + workflows: version: 2 @@ -537,6 +584,10 @@ workflows: - spectest: requires: - coverage-clang + - bindings-rust + - bindings-rust-asan: + requires: + - bindings-rust benchmarking: when: <>