From c7f754fe4d5e032fd150c4b9b985855e9fcaa521 Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Mon, 1 Mar 2021 23:50:54 +0100 Subject: [PATCH] ci: Run PRs on merge result instead of on the source branch This is taken from Bitcoin Core's .cirrus.yml --- .cirrus.yml | 14 ++++++++++++-- ci/linux-debian.Dockerfile | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index ac33507733897..ce904d3e43e36 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -16,8 +16,6 @@ env: CTIMETEST: yes BENCH: yes ITERS: 2 - # We only need the top commit - CIRRUS_CLONE_DEPTH: 1 cat_logs_snippet: &CAT_LOGS always: @@ -32,6 +30,14 @@ cat_logs_snippet: &CAT_LOGS - cat test_env.log || true - env +merge_base_script_snippet: &MERGE_BASE + merge_base_script: + - if [ "$CIRRUS_PR" = "" ]; then exit 0; fi + - git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH + - git config --global user.email "ci@ci.ci" + - git config --global user.name "ci" + - git merge FETCH_HEAD # Merge base to detect silent merge conflicts + task: name: "x86_64: Linux (Debian stable)" container: @@ -81,6 +87,7 @@ task: CC: gcc - env: CC: clang + << : *MERGE_BASE test_script: - ./ci/cirrus.sh << : *CAT_LOGS @@ -107,6 +114,7 @@ task: BIGNUM: gmp - env: BIGNUM: no + << : *MERGE_BASE test_script: - ./ci/cirrus.sh << : *CAT_LOGS @@ -163,6 +171,7 @@ task: - brew link valgrind brew_script: - brew install automake libtool gmp gcc@9 + << : *MERGE_BASE test_script: - ./ci/cirrus.sh << : *CAT_LOGS @@ -184,6 +193,7 @@ task: EXPERIMENTAL: yes SCHNORRSIG: yes CTIMETEST: no + << : *MERGE_BASE test_script: # https://sourceware.org/bugzilla/show_bug.cgi?id=27008 - rm /etc/ld.so.cache diff --git a/ci/linux-debian.Dockerfile b/ci/linux-debian.Dockerfile index 8fe50f17e0651..201ace4f69a57 100644 --- a/ci/linux-debian.Dockerfile +++ b/ci/linux-debian.Dockerfile @@ -6,6 +6,7 @@ RUN apt-get update # dkpg-dev: to make pkg-config work in cross-builds RUN apt-get install --no-install-recommends --no-upgrade -y \ + git ca-certificates \ make automake libtool pkg-config dpkg-dev valgrind qemu-user \ gcc clang libc6-dbg libgmp-dev \ gcc-i686-linux-gnu libc6-dev-i386-cross libc6-dbg:i386 libgmp-dev:i386 \