Merge #20697: ci: Fix COMMIT_RANGE variable value for PRs

3c2478c38522c176e81befd4d991a259b09be063 ci: Print COMMIT_RANGE to the log as it was in Travis CI (Hennadii Stepanov)
c123892c2e47e3706f06820aba2454d494a39564 ci: Drop Travis-specific workaround for shellcheck (Hennadii Stepanov)
10af252d97532843b26505d215f6e975f4b21672 ci: Drop Travis-specific way to set COMMIT_RANGE variable (Hennadii Stepanov)
93504da3a932f33126545ebc9383f695a6efe51e ci: Fix COMMIT_RANGE variable value for PRs (Hennadii Stepanov)

Pull request description:

  This PR:
  - is a #20658 and #20682  followup
  - set the `COMMIT_RANGE` variable correctly for PRs
  - cleans up Travis-specific code
  - prints COMMIT_RANGE value to the log for convenience as it was in Travis CI

ACKs for top commit:
  MarcoFalke:
    ACK 3c2478c38522c176e81befd4d991a259b09be063

Tree-SHA512: beb933352b10fd5eb3e66373ddb62439e4f3a03b50fb037ee89fa92c0706cec41d05f2d307f15bb18d1e634e6464f4e123b7e2f88703c8edfd145d8d6eff0b1a
This commit is contained in:
MarcoFalke 2020-12-21 12:08:35 +01:00 committed by Konstantin Akimov
parent 53ca879837
commit 802cb9521f
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524
4 changed files with 6 additions and 22 deletions

View File

@ -1,9 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
export LC_ALL=C
git fetch

View File

@ -6,13 +6,12 @@
export LC_ALL=C export LC_ALL=C
GIT_HEAD=$(git rev-parse HEAD)
if [ -n "$CIRRUS_PR" ]; then if [ -n "$CIRRUS_PR" ]; then
# CIRRUS_PR will be present in a Cirrus environment. For builds triggered COMMIT_RANGE="$CIRRUS_BASE_SHA..$GIT_HEAD"
# by a pull request this is the name of the branch targeted by the pull request.
# https://cirrus-ci.org/guide/writing-tasks/#environment-variables
COMMIT_RANGE="$CIRRUS_BRANCH..HEAD"
test/lint/commit-script-check.sh $COMMIT_RANGE test/lint/commit-script-check.sh $COMMIT_RANGE
fi fi
export COMMIT_RANGE
# This only checks that the trees are pure subtrees, it is not doing a full # This only checks that the trees are pure subtrees, it is not doing a full
# check with -r to not have to fetch all the remotes. # check with -r to not have to fetch all the remotes.
@ -29,3 +28,6 @@ if [ "$CIRRUS_REPO_FULL_NAME" = "dashpay/dash" ] && [ -n "$CIRRUS_CRON" ]; then
${CI_RETRY_EXE} gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $(<contrib/verify-commits/trusted-keys) && ${CI_RETRY_EXE} gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $(<contrib/verify-commits/trusted-keys) &&
./contrib/verify-commits/verify-commits.py --clean-merge=2; ./contrib/verify-commits/verify-commits.py --clean-merge=2;
fi fi
echo
git log --no-merges --oneline $COMMIT_RANGE

View File

@ -8,5 +8,4 @@ export LC_ALL=C.UTF-8
set -o errexit; source ./ci/test/00_setup_env.sh set -o errexit; source ./ci/test/00_setup_env.sh
set -o errexit; source ./ci/lint/04_install.sh set -o errexit; source ./ci/lint/04_install.sh
set -o errexit; source ./ci/lint/05_before_script.sh
set -o errexit; source ./ci/lint/06_script.sh set -o errexit; source ./ci/lint/06_script.sh

View File

@ -8,14 +8,6 @@
export LC_ALL=C export LC_ALL=C
# The shellcheck binary segfault/coredumps in Travis with LC_ALL=C
# It does not do so in Ubuntu 14.04, 16.04, 18.04 in versions 0.3.3, 0.3.7, 0.4.6
# respectively. So export LC_ALL=C is set as required by lint-shell-locale.sh
# but unset here in case of running in Travis.
if [ "$TRAVIS" = "true" ]; then
unset LC_ALL
fi
# Disabled warnings: # Disabled warnings:
disabled=( disabled=(
SC2046 # Quote this to prevent word splitting. SC2046 # Quote this to prevent word splitting.