Only force up-to-date lock files on edge

This commit is contained in:
Michael Vines
2020-06-18 10:04:37 -07:00
committed by mergify[bot]
parent 7df8f76df1
commit 486812bf54
4 changed files with 19 additions and 13 deletions

View File

@ -67,6 +67,7 @@ ARGS+=(
--env BUILDKITE_JOB_ID --env BUILDKITE_JOB_ID
--env CI --env CI
--env CI_BRANCH --env CI_BRANCH
--env CI_BASE_BRANCH
--env CI_TAG --env CI_TAG
--env CI_BUILD_ID --env CI_BUILD_ID
--env CI_COMMIT --env CI_COMMIT

View File

@ -8,6 +8,7 @@ if [[ -n $CI ]]; then
export CI=1 export CI=1
if [[ -n $TRAVIS ]]; then if [[ -n $TRAVIS ]]; then
export CI_BRANCH=$TRAVIS_BRANCH export CI_BRANCH=$TRAVIS_BRANCH
export CI_BASE_BRANCH=$TRAVIS_BRANCH
export CI_BUILD_ID=$TRAVIS_BUILD_ID export CI_BUILD_ID=$TRAVIS_BUILD_ID
export CI_COMMIT=$TRAVIS_COMMIT export CI_COMMIT=$TRAVIS_COMMIT
export CI_JOB_ID=$TRAVIS_JOB_ID export CI_JOB_ID=$TRAVIS_JOB_ID
@ -28,8 +29,10 @@ if [[ -n $CI ]]; then
# to how solana-ci-gate is used to trigger PR builds rather than using the # to how solana-ci-gate is used to trigger PR builds rather than using the
# standard Buildkite PR trigger. # standard Buildkite PR trigger.
if [[ $CI_BRANCH =~ pull/* ]]; then if [[ $CI_BRANCH =~ pull/* ]]; then
export CI_BASE_BRANCH=$BUILDKITE_PULL_REQUEST_BASE_BRANCH
export CI_PULL_REQUEST=true export CI_PULL_REQUEST=true
else else
export CI_BASE_BRANCH=$BUILDKITE_BRANCH
export CI_PULL_REQUEST= export CI_PULL_REQUEST=
fi fi
export CI_OS_NAME=linux export CI_OS_NAME=linux

View File

@ -6,17 +6,24 @@ cd "$(dirname "$0")/.."
source ci/_ source ci/_
source ci/rust-version.sh stable source ci/rust-version.sh stable
source ci/rust-version.sh nightly source ci/rust-version.sh nightly
eval "$(ci/channel-info.sh)"
export RUST_BACKTRACE=1 export RUST_BACKTRACE=1
export RUSTFLAGS="-D warnings" export RUSTFLAGS="-D warnings"
if _ scripts/cargo-for-all-lock-files.sh +"$rust_nightly" check --locked --all-targets; then
true # Only force up-to-date lock files on edge
if [[ $CI_BASE_BRANCH = "$EDGE_CHANNEL" ]]; then
if _ scripts/cargo-for-all-lock-files.sh +"$rust_nightly" check --locked --all-targets; then
true
else
check_status=$?
echo "Some Cargo.lock is outdated; please update them as well"
echo "protip: you can use ./scripts/cargo-for-all-lock-files.sh update ..."
exit "$check_status"
fi
else else
check_status=$? echo "Note: cargo-for-all-lock-files.sh skipped because $CI_BASE_BRANCH != $EDGE_CHANNEL"
echo "Some Cargo.lock is outdated; please update them as well"
echo "protip: you can use ./scripts/cargo-for-all-lock-files.sh update ..."
exit "$check_status"
fi fi
_ cargo +"$rust_stable" fmt --all -- --check _ cargo +"$rust_stable" fmt --all -- --check

View File

@ -10,13 +10,8 @@ source ci/_
set -x set -x
# Look for failed mergify.io backports by searching leftover conflict markers # Look for failed mergify.io backports by searching leftover conflict markers
# Also check for any trailing whitespaces! # Also check for any trailing whitespaces!
if [[ -n $BUILDKITE_PULL_REQUEST_BASE_BRANCH ]]; then git fetch origin "$CI_BASE_BRANCH"
base_branch=$BUILDKITE_PULL_REQUEST_BASE_BRANCH git diff "$(git merge-base HEAD "origin/$CI_BASE_BRANCH")..HEAD" --check --oneline
else
base_branch=$BUILDKITE_BRANCH
fi
git fetch origin "$base_branch"
git diff "$(git merge-base HEAD "origin/$base_branch")..HEAD" --check --oneline
) )
echo echo