From 34514d65bc46028e6b3f8e66181033f49e10bd36 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Mon, 21 May 2018 23:02:54 -0700 Subject: [PATCH] Add in-tree buildkite pipeline --- ci/buildkite.yml | 14 ++++++++++++++ ci/coverage.sh | 17 +++++++++++++++++ ci/publish.sh | 19 +++++++++++++++++++ ci/test-cuda.sh | 17 +++++++++++++++++ ci/test-ignored.sh | 8 ++++++++ ci/test-nightly.sh | 11 +++++++++++ ci/test-stable.sh | 11 +++++++++++ 7 files changed, 97 insertions(+) create mode 100644 ci/buildkite.yml create mode 100755 ci/coverage.sh create mode 100755 ci/publish.sh create mode 100755 ci/test-cuda.sh create mode 100755 ci/test-ignored.sh create mode 100755 ci/test-nightly.sh create mode 100755 ci/test-stable.sh diff --git a/ci/buildkite.yml b/ci/buildkite.yml new file mode 100644 index 00000000000000..e6eb08c98db09a --- /dev/null +++ b/ci/buildkite.yml @@ -0,0 +1,14 @@ +steps: + - command: "ci/coverage.sh" + label: "coverage [public]" + - command: "ci/test-stable.sh" + label: "stable [public]" + - command: "ci/test-nightly.sh || true" + label: "nightly - FAILURES IGNORED [public]" + - command: "ci/test-ignored.sh || true" + label: "ignored - FAILURES IGNORED [public]" + - command: "ci/test-cuda.sh" + label: "cuda" + - wait + - command: "ci/publish.sh" + label: "publish release artifacts" diff --git a/ci/coverage.sh b/ci/coverage.sh new file mode 100755 index 00000000000000..8a5a674843a799 --- /dev/null +++ b/ci/coverage.sh @@ -0,0 +1,17 @@ +#!/bin/bash -e + +cd $(dirname $0)/.. + +source $HOME/.cargo/env +rustup update +export RUST_BACKTRACE=1 +cargo build +cargo kcov + +if [[ -z "$CODECOV_TOKEN" ]]; then + echo CODECOV_TOKEN undefined + exit 1 +fi + +bash <(curl -s https://codecov.io/bash) +exit 0 diff --git a/ci/publish.sh b/ci/publish.sh new file mode 100755 index 00000000000000..3377e658c29218 --- /dev/null +++ b/ci/publish.sh @@ -0,0 +1,19 @@ +#!/bin/bash -e + +cd $(dirname $0)/.. + +if [[ -z "$BUILDKITE_TAG" ]]; then + # Skip publish if this is not a tagged release + exit 0 +fi + +if [[ -z "$CRATES_IO_TOKEN" ]]; + echo CRATES_IO_TOKEN undefined + exit 1 +fi + +cargo package +# TODO: Ensure the published version matches the contents of BUILDKITE_TAG +cargo publish --token "$CRATES_IO_TOKEN" + +exit 0 diff --git a/ci/test-cuda.sh b/ci/test-cuda.sh new file mode 100755 index 00000000000000..4b3a451d6cf757 --- /dev/null +++ b/ci/test-cuda.sh @@ -0,0 +1,17 @@ +#!/bin/bash -e + +cd $(dirname $0)/.. + +if [[ -z "$libcuda_verify_ed25519_URL" ]]; then + echo libcuda_verify_ed25519_URL undefined + exit 1 +fi + +export LD_LIBRARY_PATH=/usr/local/cuda/lib64 +export PATH=$PATH:/usr/local/cuda/bin +curl -X GET -o libcuda_verify_ed25519.a "$libcuda_verify_ed25519_URL" + +source $HOME/.cargo/env +cargo test --features=cuda + +exit 0 diff --git a/ci/test-ignored.sh b/ci/test-ignored.sh new file mode 100755 index 00000000000000..c317e645f6bfd4 --- /dev/null +++ b/ci/test-ignored.sh @@ -0,0 +1,8 @@ +#!/bin/bash -e + +cd $(dirname $0)/.. + +source $HOME/.cargo/env +rustup update +export RUST_BACKTRACE=1 +cargo test -- --ignored diff --git a/ci/test-nightly.sh b/ci/test-nightly.sh new file mode 100755 index 00000000000000..c3bc4cf7bf8d92 --- /dev/null +++ b/ci/test-nightly.sh @@ -0,0 +1,11 @@ +#!/bin/bash -e + +cd $(dirname $0)/.. + +source $HOME/.cargo/env +rustup component add rustfmt-preview +cargo fmt -- --write-mode=diff +cargo build --verbose --features unstable +cargo test --verbose --features unstable + +exit 0 diff --git a/ci/test-stable.sh b/ci/test-stable.sh new file mode 100755 index 00000000000000..c4c179a4788989 --- /dev/null +++ b/ci/test-stable.sh @@ -0,0 +1,11 @@ +#!/bin/bash -e + +cd $(dirname $0)/.. + +source $HOME/.cargo/env +rustup component add rustfmt-preview +cargo fmt -- --write-mode=diff +cargo build --verbose +cargo test --verbose + +exit 0