Skip to content

Commit fad4f48

Browse files
author
MarcoFalke
committed
ci: [refactor] Create setting for ephemeral config in .cirrus.yml
This allows easier switching between self-hosted runners and the community cluster. Also, named variables can be documented better.
1 parent 265a3a7 commit fad4f48

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.cirrus.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
env:
44
PACKAGE_MANAGER_INSTALL: "apt-get update && apt-get install -y"
55
MAKEJOBS: "-j4"
6-
DANGER_RUN_CI_ON_HOST: "1" # Containers will be discarded after the run, so there is no risk that the ci scripts modify the system
76
TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache
87
CCACHE_SIZE: "200M"
98
CCACHE_DIR: "/tmp/ccache_dir"
109

10+
cirrus_ephemeral_worker_template_env: &CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
11+
DANGER_RUN_CI_ON_HOST: "1" # Containers will be discarded after the run, so there is no risk that the ci scripts modify the system
12+
1113
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
1214
base_template: &BASE_TEMPLATE
1315
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
@@ -69,13 +71,16 @@ task:
6971
<< : *CREDITS_TEMPLATE
7072
lint_script:
7173
- ./ci/lint_run_all.sh
74+
env:
75+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
7276

7377
task:
7478
name: 'ARM [unit tests, no functional tests] [buster]'
7579
<< : *GLOBAL_TASK_TEMPLATE
7680
container:
7781
image: debian:buster
7882
env:
83+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
7984
FILE_ENV: "./ci/test/00_setup_env_arm.sh"
8085

8186
task:
@@ -84,6 +89,7 @@ task:
8489
container:
8590
image: ubuntu:focal
8691
env:
92+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
8793
FILE_ENV: "./ci/test/00_setup_env_win64.sh"
8894

8995
task:
@@ -92,6 +98,7 @@ task:
9298
container:
9399
image: centos:8
94100
env:
101+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
95102
PACKAGE_MANAGER_INSTALL: "yum install -y"
96103
FILE_ENV: "./ci/test/00_setup_env_i686_centos.sh"
97104

@@ -105,6 +112,7 @@ task:
105112
container:
106113
image: ubuntu:bionic
107114
env:
115+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
108116
FILE_ENV: "./ci/test/00_setup_env_native_qt5.sh"
109117

110118
task:
@@ -115,6 +123,7 @@ task:
115123
cpu: 6 # Increase CPU and Memory to avoid timeout
116124
memory: 24G
117125
env:
126+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
118127
MAKEJOBS: "-j8"
119128
FILE_ENV: "./ci/test/00_setup_env_native_tsan.sh"
120129

@@ -124,6 +133,7 @@ task:
124133
container:
125134
image: ubuntu:focal
126135
env:
136+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
127137
FILE_ENV: "./ci/test/00_setup_env_native_msan.sh"
128138

129139
task:
@@ -132,6 +142,7 @@ task:
132142
container:
133143
image: ubuntu:focal
134144
env:
145+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
135146
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"
136147

137148
task:
@@ -140,6 +151,7 @@ task:
140151
container:
141152
image: ubuntu:focal
142153
env:
154+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
143155
FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh"
144156

145157
task:
@@ -148,6 +160,7 @@ task:
148160
container:
149161
image: ubuntu:focal
150162
env:
163+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
151164
FILE_ENV: "./ci/test/00_setup_env_native_multiprocess.sh"
152165

153166
task:
@@ -156,6 +169,7 @@ task:
156169
container:
157170
image: ubuntu:bionic
158171
env:
172+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
159173
FILE_ENV: "./ci/test/00_setup_env_native_nowallet.sh"
160174

161175
task:
@@ -164,6 +178,7 @@ task:
164178
container:
165179
image: ubuntu:focal
166180
env:
181+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
167182
FILE_ENV: "./ci/test/00_setup_env_mac.sh"
168183

169184
task:
@@ -175,7 +190,7 @@ task:
175190
# Use latest image, but hardcode version to avoid silent upgrades (and breaks)
176191
image: big-sur-xcode-12.4 # https://cirrus-ci.org/guide/macOS
177192
env:
178-
DANGER_RUN_CI_ON_HOST: "true"
193+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
179194
CI_USE_APT_INSTALL: "no"
180195
PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do
181196
FILE_ENV: "./ci/test/00_setup_env_mac_host.sh"
@@ -188,4 +203,5 @@ task:
188203
container:
189204
image: ubuntu:focal
190205
env:
206+
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
191207
FILE_ENV: "./ci/test/00_setup_env_android.sh"

0 commit comments

Comments
 (0)