From be5f2ef9b931331c2d3a4fa4e998a52c52af86ff Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sun, 24 Jun 2018 21:24:08 -0700 Subject: [PATCH] Consolidate CI jobs --- ci/buildkite.yml | 16 ++++--------- ci/coverage.sh | 18 -------------- ci/docker-run.sh | 2 +- ci/run-local.sh | 2 +- ci/snap.sh | 10 +++++++- ci/test-erasure.sh | 13 ---------- ci/test-ignored.sh | 9 ------- ci/test-nightly.sh | 30 +++++++++++++++++++----- ci/{test-cuda.sh => test-stable-perf.sh} | 7 +++--- ci/test-stable.sh | 16 ++++++++----- 10 files changed, 53 insertions(+), 70 deletions(-) delete mode 100755 ci/coverage.sh delete mode 100755 ci/test-erasure.sh delete mode 100755 ci/test-ignored.sh rename ci/{test-cuda.sh => test-stable-perf.sh} (56%) diff --git a/ci/buildkite.yml b/ci/buildkite.yml index d6cc061cf..2d69fbdca 100644 --- a/ci/buildkite.yml +++ b/ci/buildkite.yml @@ -2,15 +2,15 @@ steps: - command: "ci/docker-run.sh rust ci/test-stable.sh" name: "stable [public]" timeout_in_minutes: 20 + - command: "ci/shellcheck.sh" + name: "shellcheck [public]" + timeout_in_minutes: 20 - wait - command: "ci/docker-run.sh rustlang/rust:nightly ci/test-nightly.sh" name: "nightly [public]" timeout_in_minutes: 20 - - command: "ci/docker-run.sh rust ci/test-ignored.sh" - name: "ignored [public]" - timeout_in_minutes: 20 - - command: "ci/test-cuda.sh" - name: "cuda [public]" + - command: "ci/test-stable-perf.sh" + name: "stable-perf [public]" timeout_in_minutes: 20 retry: automatic: @@ -18,12 +18,6 @@ steps: limit: 2 agents: - "queue=cuda" - - command: "ci/shellcheck.sh" - name: "shellcheck [public]" - timeout_in_minutes: 20 - - command: "ci/docker-run.sh rust ci/test-erasure.sh" - name: "erasure [public]" - timeout_in_minutes: 20 - command: "ci/snap.sh [public]" timeout_in_minutes: 20 name: "snap [public]" diff --git a/ci/coverage.sh b/ci/coverage.sh deleted file mode 100755 index 166235cdf..000000000 --- a/ci/coverage.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -e - -cd "$(dirname "$0")/.." - -cargo install --force cargo-cov -cargo cov test -cargo cov report - -echo Coverage report: -ls -l target/cov/report/index.html - -if [[ -z "$CODECOV_TOKEN" ]]; then - echo CODECOV_TOKEN undefined -else - bash <(curl -s https://codecov.io/bash) -x 'llvm-cov gcov' -fi - -exit 0 diff --git a/ci/docker-run.sh b/ci/docker-run.sh index ab2011d95..b37ff28df 100755 --- a/ci/docker-run.sh +++ b/ci/docker-run.sh @@ -47,4 +47,4 @@ ARGS+=( ) set -x -docker run "${ARGS[@]}" "$IMAGE" "$@" +exec docker run "${ARGS[@]}" "$IMAGE" "$@" diff --git a/ci/run-local.sh b/ci/run-local.sh index 884825765..20a777b6d 100755 --- a/ci/run-local.sh +++ b/ci/run-local.sh @@ -16,4 +16,4 @@ if [[ ! -x $BKRUN ]]; then fi set -x -./ci/node_modules/.bin/bkrun ci/buildkite.yml +exec ./ci/node_modules/.bin/bkrun ci/buildkite.yml diff --git a/ci/snap.sh b/ci/snap.sh index ad9232a7b..c12a9f280 100755 --- a/ci/snap.sh +++ b/ci/snap.sh @@ -13,7 +13,11 @@ else SNAP_CHANNEL=beta fi -if [[ -n $SNAPCRAFT_CREDENTIALS_KEY ]]; then +if [[ -z $DRYRUN ]]; then + [[ -n $SNAPCRAFT_CREDENTIALS_KEY ]] || { + echo SNAPCRAFT_CREDENTIALS_KEY not defined + exit 1; + } ( openssl aes-256-cbc -d \ -in ci/snapcraft.credentials.enc \ @@ -28,5 +32,9 @@ if [[ -n $SNAPCRAFT_CREDENTIALS_KEY ]]; then fi set -x + +echo --- build snapcraft + +echo --- publish $DRYRUN snapcraft push solana_*.snap --release $SNAP_CHANNEL diff --git a/ci/test-erasure.sh b/ci/test-erasure.sh deleted file mode 100755 index 8705abe38..000000000 --- a/ci/test-erasure.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -e - -set -o xtrace - -cd "$(dirname "$0")/.." - -./fetch-perf-libs.sh - -export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH - -cargo test --features="erasure" - -exit 0 diff --git a/ci/test-ignored.sh b/ci/test-ignored.sh deleted file mode 100755 index cab9545c8..000000000 --- a/ci/test-ignored.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -e - -cd "$(dirname "$0")/.." - -rustc --version -cargo --version - -export RUST_BACKTRACE=1 -cargo test -- --ignored diff --git a/ci/test-nightly.sh b/ci/test-nightly.sh index 3f38e3d1b..512c8d7bf 100755 --- a/ci/test-nightly.sh +++ b/ci/test-nightly.sh @@ -2,13 +2,31 @@ cd "$(dirname "$0")/.." +export RUST_BACKTRACE=1 rustc --version cargo --version -export RUST_BACKTRACE=1 -cargo build --verbose --features unstable -cargo test --verbose --features unstable -cargo bench --verbose --features unstable -ci/coverage.sh +_() { + echo "--- $*" + "$@" +} + +_ cargo build --verbose --features unstable +_ cargo test --verbose --features unstable +_ cargo bench --verbose --features unstable + + +# Coverage ... +_ cargo install --force cargo-cov +_ cargo cov test +_ cargo cov report + +echo --- Coverage report: +ls -l target/cov/report/index.html + +if [[ -z "$CODECOV_TOKEN" ]]; then + echo CODECOV_TOKEN undefined +else + bash <(curl -s https://codecov.io/bash) -x 'llvm-cov gcov' +fi -exit 0 diff --git a/ci/test-cuda.sh b/ci/test-stable-perf.sh similarity index 56% rename from ci/test-cuda.sh rename to ci/test-stable-perf.sh index ba6f0b1c1..ca0bc5a4b 100755 --- a/ci/test-cuda.sh +++ b/ci/test-stable-perf.sh @@ -4,10 +4,9 @@ cd "$(dirname "$0")/.." ./fetch-perf-libs.sh -export LD_LIBRARY_PATH=/usr/local/cuda/lib64 +export LD_LIBRARY_PATH=$PWD:/usr/local/cuda/lib64 export PATH=$PATH:/usr/local/cuda/bin - export RUST_BACKTRACE=1 -cargo test --features=cuda -exit 0 +set -x +exec cargo test --features=cuda,erasure diff --git a/ci/test-stable.sh b/ci/test-stable.sh index f21b465ac..9c31a3afd 100755 --- a/ci/test-stable.sh +++ b/ci/test-stable.sh @@ -2,13 +2,17 @@ cd "$(dirname "$0")/.." +export RUST_BACKTRACE=1 rustc --version cargo --version -export RUST_BACKTRACE=1 -rustup component add rustfmt-preview -cargo fmt -- --write-mode=diff -cargo build --verbose -cargo test --verbose +_() { + echo "--- $*" + "$@" +} -exit 0 +_ rustup component add rustfmt-preview +_ cargo fmt -- --write-mode=diff +_ cargo build --verbose +_ cargo test --verbose +_ cargo test -- --ignored