ci: Run PRs on merge result instead of on the source branch

This is taken from Bitcoin Core's .cirrus.yml
This commit is contained in:
Tim Ruffing 2021-03-01 23:50:54 +01:00
parent b994a8be3c
commit c7f754fe4d
2 changed files with 13 additions and 2 deletions

View File

@ -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

View File

@ -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 \