# 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/dependabot-pr.sh"
    name: "dependabot"
    timeout_in_minutes: 5
    if: build.env("GITHUB_USER") == "dependabot-preview[bot]"

  - wait

  - command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_nightly_docker_image ci/test-checks.sh"
    name: "checks"
    timeout_in_minutes: 20
  - command: "ci/shellcheck.sh"
    name: "shellcheck"
    timeout_in_minutes: 5

  - wait

  - command: "ci/maybe-trigger-tests.sh"
    name: "maybe-trigger-tests"
    timeout_in_minutes: 2

  - wait

  - trigger: "solana-secondary"
    branches: "!pull/*"
    async: true
    build:
      message: "${BUILDKITE_MESSAGE}"
      commit: "${BUILDKITE_COMMIT}"
      branch: "${BUILDKITE_BRANCH}"
      env:
        TRIGGERED_BUILDKITE_TAG: "${BUILDKITE_TAG}"
