Skip to content

Commit facf5e3

Browse files
author
MarcoFalke
committed
ci: Only use credits for pull requests to the main repo
1 parent 6f2ca72 commit facf5e3

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

.cirrus.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@ env:
88
CCACHE_SIZE: "200M"
99
CCACHE_DIR: "/tmp/ccache_dir"
1010

11-
### Base template
1211
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
1312
base_template: &BASE_TEMPLATE
14-
skip: $CIRRUS_REPO_FULL_NAME == "bitcoin-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
13+
skip: $CIRRUS_REPO_FULL_NAME == "bitcoin-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
1514
merge_base_script:
1615
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
1716
- bash -c "$PACKAGE_MANAGER_INSTALL git"
1817
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
1918
- git config --global user.email "[email protected]"
2019
- git config --global user.name "ci"
2120
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
21+
stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks
2222

23-
### Global task template
2423
global_task_template: &GLOBAL_TASK_TEMPLATE
2524
<< : *BASE_TEMPLATE
2625
timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out
@@ -41,6 +40,11 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
4140
ci_script:
4241
- ./ci/test_run_all.sh
4342

43+
compute_credits_template: &CREDITS_TEMPLATE
44+
# https://cirrus-ci.org/pricing/#compute-credits
45+
# Only use credits for pull requests to the main repo
46+
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'bitcoin/bitcoin' && $CIRRUS_PR != ""
47+
4448
#task:
4549
# name: "Windows"
4650
# windows_container:
@@ -58,13 +62,14 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
5862
# - choco install python --version=3.7.7 -y
5963

6064
task:
61-
name: 'lint'
65+
name: 'lint [bionic]'
6266
<< : *BASE_TEMPLATE
6367
container:
64-
image: ubuntu:bionic # For python 3.6, oldest supported version according to doc/dependencies.md
65-
cpu: 1 # Cut bill in half for linting
66-
# For faster CI feedback, immediately schedule the linters. https://cirrus-ci.org/pricing/#compute-credits
67-
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'bitcoin/bitcoin'
68+
image: ubuntu:bionic # For python 3.6, oldest supported version according to doc/dependencies.md
69+
cpu: 1
70+
memory: 1G
71+
# For faster CI feedback, immediately schedule the linters
72+
<< : *CREDITS_TEMPLATE
6873
setup_script:
6974
- set -o errexit; source ./ci/test/00_setup_env.sh
7075
before_install_script:
@@ -103,8 +108,8 @@ task:
103108

104109
task:
105110
name: '[previous releases, uses qt5 dev package and some depends packages] [unsigned char] [bionic]'
106-
# For faster CI feedback, immediately schedule a task that compiles most modules. https://cirrus-ci.org/pricing/#compute-credits
107-
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'bitcoin/bitcoin'
111+
# For faster CI feedback, immediately schedule a task that compiles most modules
112+
<< : *CREDITS_TEMPLATE
108113
<< : *GLOBAL_TASK_TEMPLATE
109114
container:
110115
image: ubuntu:bionic

0 commit comments

Comments
 (0)