Merge #20680: ci: Only use credits for pull requests to the main repo

facf5e37f619be6bd7f8768058842679cd9ad933 ci: Only use credits for pull requests to the main repo (MarcoFalke)

Pull request description:

  No need to spend credits for the `master` branch, because the build shouldn't fail there anyway and it is not time-critical to get a fast feedback.

  Some other changes:

  * Disable `stateful` for faster scheduling
  * Reduce lint memory from 8G to 1G for faster scheduling

ACKs for top commit:
  hebasto:
    ACK facf5e37f619be6bd7f8768058842679cd9ad933, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 4d052e68217086574b9ea3d603cde1b585833c289d47dfed5308ff001d02964dc75ec3b3ebf5b233ccd09c47ad4ff5ba0bef639bf6362d984e7c49fca8fec24b
This commit is contained in:
MarcoFalke 2020-12-17 10:41:13 +01:00 committed by Konstantin Akimov
parent 9d824de302
commit 8694479024
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524

View File

@ -9,10 +9,9 @@ env:
CCACHE_SIZE: "200M" CCACHE_SIZE: "200M"
CCACHE_DIR: "/tmp/ccache_dir" CCACHE_DIR: "/tmp/ccache_dir"
### Base template
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
base_template: &BASE_TEMPLATE base_template: &BASE_TEMPLATE
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 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
merge_base_script: merge_base_script:
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi - if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
- bash -c "$PACKAGE_MANAGER_INSTALL git" - bash -c "$PACKAGE_MANAGER_INSTALL git"
@ -20,8 +19,8 @@ base_template: &BASE_TEMPLATE
- git config --global user.email "ci@ci.ci" - git config --global user.email "ci@ci.ci"
- git config --global user.name "ci" - git config --global user.name "ci"
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts - git merge FETCH_HEAD # Merge base to detect silent merge conflicts
stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks
### Global task template
global_task_template: &GLOBAL_TASK_TEMPLATE global_task_template: &GLOBAL_TASK_TEMPLATE
<< : *BASE_TEMPLATE << : *BASE_TEMPLATE
timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out
@ -42,15 +41,21 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
ci_script: ci_script:
- ./ci/test_run_all.sh - ./ci/test_run_all.sh
compute_credits_template: &CREDITS_TEMPLATE
# https://cirrus-ci.org/pricing/#compute-credits
# Only use credits for pull requests to the main repo
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'dashpay/dash' && $CIRRUS_PR != ""
task: task:
name: 'lint' name: 'lint [bionic]'
<< : *BASE_TEMPLATE << : *BASE_TEMPLATE
container: container:
image: ubuntu:bionic # For python 3.6, oldest supported version according to doc/dependencies.md image: ubuntu:bionic # For python 3.6, oldest supported version according to doc/dependencies.md
cpu: 1 # Cut bill in half for linting cpu: 1
# For faster CI feedback, immediately schedule the linters. https://cirrus-ci.org/pricing/#compute-credits memory: 1G
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'dashpay/dash' # For faster CI feedback, immediately schedule the linters
<< : *CREDITS_TEMPLATE
setup_script: setup_script:
- set -o errexit; source ./ci/test/00_setup_env.sh - set -o errexit; source ./ci/test/00_setup_env.sh
before_install_script: before_install_script:
@ -92,8 +97,8 @@ task:
task: task:
name: '[previous releases, uses qt5 dev package and some depends packages] [unsigned char] [focal]' name: '[previous releases, uses qt5 dev package and some depends packages] [unsigned char] [focal]'
# For faster CI feedback, immediately schedule a task that compiles most modules. https://cirrus-ci.org/pricing/#compute-credits # For faster CI feedback, immediately schedule a task that compiles most modules
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'dashpay/dash' << : *CREDITS_TEMPLATE
<< : *GLOBAL_TASK_TEMPLATE << : *GLOBAL_TASK_TEMPLATE
container: container:
image: ubuntu:focal image: ubuntu:focal