2018-08-03 09:21:03 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
2022-12-24 20:49:50 -03:00
|
|
|
# Copyright (c) 2018-2022 The Bitcoin Core developers
|
2018-08-03 09:21:03 -04:00
|
|
|
# Distributed under the MIT software license, see the accompanying
|
|
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
export LC_ALL=C
|
|
|
|
|
2023-01-18 11:48:14 -03:00
|
|
|
if [ -n "$LOCAL_BRANCH" ]; then
|
|
|
|
# To faithfully recreate CI linting locally, specify all commits on the current
|
|
|
|
# branch.
|
|
|
|
COMMIT_RANGE="$(git merge-base HEAD master)..HEAD"
|
|
|
|
elif [ -n "$CIRRUS_PR" ]; then
|
2023-01-02 10:08:07 -03:00
|
|
|
COMMIT_RANGE="HEAD~..HEAD"
|
2022-11-28 07:11:01 -03:00
|
|
|
echo
|
|
|
|
git log --no-merges --oneline "$COMMIT_RANGE"
|
|
|
|
echo
|
2021-11-07 12:04:06 -03:00
|
|
|
test/lint/commit-script-check.sh "$COMMIT_RANGE"
|
2022-11-28 07:11:01 -03:00
|
|
|
else
|
|
|
|
COMMIT_RANGE="SKIP_EMPTY_NOT_A_PR"
|
2018-08-03 09:21:03 -04:00
|
|
|
fi
|
2020-12-18 07:17:25 -03:00
|
|
|
export COMMIT_RANGE
|
2018-08-03 09:21:03 -04:00
|
|
|
|
2020-12-04 05:33:15 -03:00
|
|
|
# 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.
|
2018-08-03 09:21:03 -04:00
|
|
|
test/lint/git-subtree-check.sh src/crypto/ctaes
|
|
|
|
test/lint/git-subtree-check.sh src/secp256k1
|
2020-02-18 19:45:02 -03:00
|
|
|
test/lint/git-subtree-check.sh src/minisketch
|
2018-08-03 09:21:03 -04:00
|
|
|
test/lint/git-subtree-check.sh src/leveldb
|
2019-11-07 09:43:55 -03:00
|
|
|
test/lint/git-subtree-check.sh src/crc32c
|
2018-08-03 09:21:03 -04:00
|
|
|
test/lint/check-doc.py
|
2022-06-07 04:22:45 -04:00
|
|
|
test/lint/all-lint.py
|
2018-08-03 09:21:03 -04:00
|
|
|
|
2021-08-19 05:47:58 -04:00
|
|
|
if [ "$CIRRUS_REPO_FULL_NAME" = "bitcoin/bitcoin" ] && [ "$CIRRUS_PR" = "" ] ; then
|
|
|
|
# Sanity check only the last few commits to get notified of missing sigs,
|
|
|
|
# missing keys, or expired keys. Usually there is only one new merge commit
|
|
|
|
# per push on the master branch and a few commits on release branches, so
|
|
|
|
# sanity checking only a few (10) commits seems sufficient and cheap.
|
|
|
|
git log HEAD~10 -1 --format='%H' > ./contrib/verify-commits/trusted-sha512-root-commit
|
|
|
|
git log HEAD~10 -1 --format='%H' > ./contrib/verify-commits/trusted-git-root
|
2021-11-07 09:37:56 -03:00
|
|
|
mapfile -t KEYS < contrib/verify-commits/trusted-keys
|
2022-10-03 14:51:56 -03:00
|
|
|
git config user.email "ci@ci.ci"
|
|
|
|
git config user.name "ci"
|
2021-11-07 09:37:56 -03:00
|
|
|
${CI_RETRY_EXE} gpg --keyserver hkps://keys.openpgp.org --recv-keys "${KEYS[@]}" &&
|
2021-08-19 05:47:58 -04:00
|
|
|
./contrib/verify-commits/verify-commits.py;
|
2018-08-03 09:21:03 -04:00
|
|
|
fi
|