CI: Use branch-versioned cargo throughout

This commit is contained in:
Trent Nelson
2020-10-12 21:19:41 -06:00
committed by mergify[bot]
parent dd54ea78ac
commit 66c3c6c2b3
10 changed files with 56 additions and 41 deletions

View File

@ -1,5 +1,8 @@
#!/usr/bin/env bash
here="$(dirname "$0")"
cargo="$(readlink -f "${here}/../cargo")"
set -e
shifted_args=()
@ -37,7 +40,7 @@ for lock_file in $files; do
echo "--- [$lock_file]: cargo " "${shifted_args[@]}" "$@"
fi
if (set -x && cd "$(dirname "$lock_file")" && cargo "${shifted_args[@]}" "$@"); then
if (set -x && cd "$(dirname "$lock_file")" && "$cargo" "${shifted_args[@]}" "$@"); then
# noop
true
else

View File

@ -2,6 +2,9 @@
#
# |cargo install| of the top-level crate will not install binaries for
# other workspace crates or native program crates.
here="$(dirname "$0")"
cargo="$(readlink -f "${here}../cargo")"
set -e
usage() {
@ -46,7 +49,6 @@ fi
installDir="$(mkdir -p "$installDir"; cd "$installDir"; pwd)"
mkdir -p "$installDir/bin/deps"
cargo=cargo
echo "Install location: $installDir ($buildVariant)"
@ -112,9 +114,9 @@ mkdir -p "$installDir/bin"
(
set -x
# shellcheck disable=SC2086 # Don't want to double quote $rust_version
$cargo $maybeRustVersion build $maybeReleaseFlag "${binArgs[@]}"
"$cargo" $maybeRustVersion build $maybeReleaseFlag "${binArgs[@]}"
# shellcheck disable=SC2086 # Don't want to double quote $rust_version
$cargo $maybeRustVersion install spl-token-cli --root "$installDir"
"$cargo" $maybeRustVersion install spl-token-cli --root "$installDir"
)
for bin in "${BINS[@]}"; do

View File

@ -9,6 +9,8 @@ set -e
cd "$(dirname "$0")/.."
source ci/_
cargo="$(readlink -f "./cargo")"
: "${CI_COMMIT:=local}"
reportName="lcov-${CI_COMMIT:0:9}"
@ -40,8 +42,6 @@ mkdir -p target/cov
# Mark the base time for a clean room dir
touch target/cov/before-test
source ci/rust-version.sh nightly
# Force rebuild of possibly-cached proc macro crates and build.rs because
# we always want stable coverage for them
# Don't support odd file names in our repo ever
@ -52,8 +52,8 @@ if [[ -n $CI || -z $1 ]]; then
$(git grep -l "proc-macro.*true" :**/Cargo.toml | sed 's|Cargo.toml|src/lib.rs|')
fi
RUST_LOG=solana=trace _ cargo +$rust_nightly test --target-dir target/cov --no-run "${packages[@]}"
if RUST_LOG=solana=trace _ cargo +$rust_nightly test --target-dir target/cov "${packages[@]}" 2> target/cov/coverage-stderr.log; then
RUST_LOG=solana=trace _ "$cargo" nightly test --target-dir target/cov --no-run "${packages[@]}"
if RUST_LOG=solana=trace _ "$cargo" nightly test --target-dir target/cov "${packages[@]}" 2> target/cov/coverage-stderr.log; then
test_status=0
else
test_status=$?