From 19693a85cd0610920db6ba65447d9a1d94ef67c0 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 1 Apr 2020 14:18:29 -0600 Subject: [PATCH] Do not trigger tests if only docs were modified (#9240) --- ci/buildkite-tests.yml | 37 ++++++++++++++++++++++++++++++++++ ci/buildkite.yml | 42 ++++++++++----------------------------- ci/maybe-trigger-tests.sh | 21 ++++++++++++++++++++ 3 files changed, 69 insertions(+), 31 deletions(-) create mode 100644 ci/buildkite-tests.yml create mode 100755 ci/maybe-trigger-tests.sh diff --git a/ci/buildkite-tests.yml b/ci/buildkite-tests.yml new file mode 100644 index 000000000..119241240 --- /dev/null +++ b/ci/buildkite-tests.yml @@ -0,0 +1,37 @@ +# These steps are conditionally triggered by ci/buildkite.yml when files +# other than those in docs/ are modified + +steps: + - command: "ci/shellcheck.sh" + name: "shellcheck" + timeout_in_minutes: 5 + + - wait + + - command: "ci/test-stable-perf.sh" + name: "stable-perf" + timeout_in_minutes: 40 + artifact_paths: "log-*.txt" + agents: + - "queue=cuda" + - command: "ci/test-bench.sh" + name: "bench" + timeout_in_minutes: 30 + - command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_stable_docker_image ci/test-stable.sh" + name: "stable" + timeout_in_minutes: 60 + artifact_paths: "log-*.txt" + agents: + - "queue=rpc-test-capable" + - command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_stable_docker_image ci/test-move.sh" + name: "move" + timeout_in_minutes: 20 + - command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_stable_docker_image ci/test-local-cluster.sh" + name: "local-cluster" + timeout_in_minutes: 45 + artifact_paths: "log-*.txt" + - command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_nightly_docker_image ci/test-coverage.sh" + name: "coverage" + timeout_in_minutes: 30 + agents: + - "queue=rpc-test-capable" diff --git a/ci/buildkite.yml b/ci/buildkite.yml index 5ab7cd078..41f9e22e4 100644 --- a/ci/buildkite.yml +++ b/ci/buildkite.yml @@ -1,42 +1,22 @@ # Build steps that run on pushes and pull requests. +# If files other than those in docs/ were modified, this will be followed up by +# ci/buildkite-tests.yml # # Release tags use buildkite-release.yml instead + steps: - - command: "ci/shellcheck.sh" - name: "shellcheck" - timeout_in_minutes: 5 - command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_nightly_docker_image ci/test-checks.sh" name: "checks" - timeout_in_minutes: 20 + timeout_in_minutes: 5 + - wait - - command: "ci/test-stable-perf.sh" - name: "stable-perf" - timeout_in_minutes: 40 - artifact_paths: "log-*.txt" - agents: - - "queue=cuda" - - command: "ci/test-bench.sh" - name: "bench" - timeout_in_minutes: 30 - - command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_stable_docker_image ci/test-stable.sh" - name: "stable" - timeout_in_minutes: 60 - artifact_paths: "log-*.txt" - agents: - - "queue=rpc-test-capable" - - command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_stable_docker_image ci/test-move.sh" - name: "move" - timeout_in_minutes: 20 - - command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_stable_docker_image ci/test-local-cluster.sh" - name: "local-cluster" - timeout_in_minutes: 45 - artifact_paths: "log-*.txt" - - command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_nightly_docker_image ci/test-coverage.sh" - name: "coverage" - timeout_in_minutes: 30 - agents: - - "queue=rpc-test-capable" + + - command: "ci/maybe-trigger-tests.sh" + name: "maybe-trigger-tests" + timeout_in_minutes: 2 + - wait + - trigger: "solana-secondary" branches: "!pull/*" async: true diff --git a/ci/maybe-trigger-tests.sh b/ci/maybe-trigger-tests.sh new file mode 100755 index 000000000..db8a514bd --- /dev/null +++ b/ci/maybe-trigger-tests.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -e +cd "$(dirname "$0")/.." + +annotate() { + ${BUILDKITE:-false} && { + buildkite-agent annotate "$@" + } +} + +# Skip if only the docs have been modified +ci/affects-files.sh \ + \!^docs/ \ +|| { + annotate --style info \ + "Skipping all further tests as only docs/ files were modified" + exit 0 +} + +annotate --style info "Triggering tests" +buildkite-agent pipeline upload ci/buildkite-tests.yml