ci: [refactor] Rename CIRRUS_PR env var to LINT_CI_IS_PR
The CIRRUS_PR env var was cirrus-specific and using a provider-agnostic name makes more sense. Also, enable pipefail, while touching this file. This refactor is needed for the next commit.
This commit is contained in:
2 files changed
+11
-9
No files matched your search
@@ -35,13 +35,15 @@ def main():
|
|||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
run(build_cmd)
|
run(build_cmd)
|
||||||
|
|
||||||
CIRRUS_PR_FLAG = []
|
extra_env = []
|
||||||
if os.environ.get("GITHUB_EVENT_NAME") == "pull_request":
|
if os.environ["GITHUB_EVENT_NAME"] == "pull_request":
|
||||||
CIRRUS_PR_FLAG = ["-e", "CIRRUS_PR=1"]
|
extra_env = ["--env", "LINT_CI_IS_PR=1"]
|
||||||
|
|
||||||
run([
|
run([
|
||||||
"docker", "run", "--rm",
|
"docker",
|
||||||
*CIRRUS_PR_FLAG,
|
"run",
|
||||||
|
"--rm",
|
||||||
|
*extra_env,
|
||||||
f"--volume={os.getcwd()}:/bitcoin",
|
f"--volume={os.getcwd()}:/bitcoin",
|
||||||
CONTAINER_NAME,
|
CONTAINER_NAME,
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -6,19 +6,19 @@
|
|||||||
|
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
|
|
||||||
set -ex
|
set -o errexit -o pipefail -o xtrace
|
||||||
|
|
||||||
if [ -n "$CIRRUS_PR" ]; then
|
if [ -n "${LINT_CI_IS_PR}" ]; then
|
||||||
export COMMIT_RANGE="HEAD~..HEAD"
|
export COMMIT_RANGE="HEAD~..HEAD"
|
||||||
if [ "$(git rev-list -1 HEAD)" != "$(git rev-list -1 --merges HEAD)" ]; then
|
if [ "$(git rev-list -1 HEAD)" != "$(git rev-list -1 --merges HEAD)" ]; then
|
||||||
echo "Error: The top commit must be a merge commit, usually the remote 'pull/${PR_NUMBER}/merge' branch."
|
echo "Error: The top commit must be a merge commit, usually the remote 'pull/<PR_NUMBER>/merge' branch."
|
||||||
false
|
false
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RUST_BACKTRACE=1 cargo run --manifest-path "./test/lint/test_runner/Cargo.toml"
|
RUST_BACKTRACE=1 cargo run --manifest-path "./test/lint/test_runner/Cargo.toml"
|
||||||
|
|
||||||
if [ "$CIRRUS_REPO_FULL_NAME" = "bitcoin/bitcoin" ] && [ "$CIRRUS_PR" = "" ] ; then
|
if [ "$CIRRUS_REPO_FULL_NAME" = "bitcoin/bitcoin" ] && [ "${LINT_CI_IS_PR}" = "" ] ; then
|
||||||
# Sanity check only the last few commits to get notified of missing sigs,
|
# 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
|
# 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
|
# per push on the master branch and a few commits on release branches, so
|
||||||
|
|||||||
Reference in new issue
Block a user