forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework buildkite pipeline construction to be more composable
- Loading branch information
Showing
13 changed files
with
132 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- command: "ci/dependabot-pr.sh" | ||
name: "dependabot" | ||
timeout_in_minutes: 5 | ||
if: build.env("GITHUB_USER") == "dependabot-preview[bot]" | ||
|
||
- wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- command: "docs/build.sh" | ||
timeout_in_minutes: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Builds a buildkite pipeline based on the environment variables | ||
# | ||
|
||
set -e | ||
cd "$(dirname "$0")"/../.. | ||
|
||
output_file=${1:-/dev/stderr} | ||
|
||
start_pipeline() { | ||
echo "# $*" > "$output_file" | ||
echo "steps:" >> "$output_file" | ||
} | ||
|
||
wait_step() { | ||
echo " - wait" >> "$output_file" | ||
} | ||
|
||
cat_steps() { | ||
cat "$@" >> "$output_file" | ||
} | ||
|
||
pull_or_push_steps() { | ||
cat_steps ci/buildkite/sanity.yml | ||
wait_step | ||
|
||
if ci/affects-files.sh .sh$; then | ||
cat_steps ci/buildkite/shellcheck.yml | ||
fi | ||
wait_step | ||
|
||
docs=false | ||
all_tests=false | ||
|
||
if ci/affects-files.sh ^docs/; then | ||
docs=true | ||
fi | ||
|
||
if ci/affects-files.sh !^docs/ !.md$ !^.buildkite/; then | ||
all_tests=true | ||
fi | ||
|
||
if $docs; then | ||
cat_steps ci/buildkite/docs.yml | ||
fi | ||
|
||
if $all_tests; then | ||
cat_steps ci/buildkite/all-tests.yml | ||
fi | ||
} | ||
|
||
|
||
if [[ -n $BUILDKITE_TAG ]]; then | ||
start_pipeline "Tag pipeline for $BUILDKITE_TAG" | ||
|
||
buildkite-agent annotate --style info --context release-tag \ | ||
"https://github.com/solana-labs/solana/releases/$BUILDKITE_TAG" | ||
|
||
# Jump directly to the secondary build to publish release artifacts quickly | ||
cat_steps ci/buildkite/trigger-secondary.yml | ||
exit 0 | ||
fi | ||
|
||
|
||
if [[ $BUILDKITE_BRANCH =~ ^pull ]]; then | ||
start_pipeline "Pull request pipeline for $BUILDKITE_BRANCH" | ||
|
||
# Add helpful link back to the corresponding Github Pull Request | ||
buildkite-agent annotate --style info --context pr-backlink \ | ||
"Github Pull Request: https://github.com/solana-labs/solana/$BUILDKITE_BRANCH" | ||
|
||
cat_steps ci/buildkite/dependabot-pr.yml | ||
pull_or_push_steps | ||
exit 0 | ||
fi | ||
|
||
start_pipeline "Push pipeline for $BUILDKITE_BRANCH" | ||
pull_or_push_steps | ||
wait_step | ||
cat_steps ci/buildkite/trigger-secondary.yml | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- command: "ci/test-sanity.sh" | ||
name: "sanity" | ||
timeout_in_minutes: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- command: "ci/shellcheck.sh" | ||
name: "shellcheck" | ||
timeout_in_minutes: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- trigger: "solana-secondary" | ||
branches: "!pull/*" | ||
async: true | ||
build: | ||
message: "${BUILDKITE_MESSAGE}" | ||
commit: "${BUILDKITE_COMMIT}" | ||
branch: "${BUILDKITE_BRANCH}" | ||
env: | ||
TRIGGERED_BUILDKITE_TAG: "${BUILDKITE_TAG}" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
source ci/_ | ||
|
||
# Look for failed mergify.io backports | ||
_ git show HEAD --check --oneline | ||
|
||
_ ci/nits.sh | ||
_ ci/check-ssh-keys.sh | ||
|
||
echo --- ok |