Skip to content

Commit 9eea51d

Browse files
committed
ci: move Asan / LSan / USDT job to Github Actions
Moving it from Cirrus CI so it can be easier to maintain and used by forks
1 parent 4b527fa commit 9eea51d

File tree

4 files changed

+47
-17
lines changed

4 files changed

+47
-17
lines changed

.cirrus.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ env: # Global defaults
4343
# The following specific types should exist, with the following requirements:
4444
# - small: For an x86_64 machine, recommended to have 2 CPUs and 8 GB of memory.
4545
# - medium: For an x86_64 machine, recommended to have 4 CPUs and 16 GB of memory.
46-
# - noble: For a machine running the Linux kernel shipped with exaclty Ubuntu Noble 24.04. The machine is recommended to have 4 CPUs and 16 GB of memory.
4746
# - arm64: For an aarch64 machine, recommended to have 2 CPUs and 8 GB of memory.
4847

4948
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
@@ -159,19 +158,6 @@ task:
159158
env:
160159
FILE_ENV: "./ci/test/00_setup_env_native_msan.sh"
161160

162-
task:
163-
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
164-
enable_bpfcc_script:
165-
# In the image build step, no external environment variables are available,
166-
# so any settings will need to be written to the settings env file:
167-
- sed -i "s|\${CIRRUS_CI}|true|g" ./ci/test/00_setup_env_native_asan.sh
168-
<< : *GLOBAL_TASK_TEMPLATE
169-
persistent_worker:
170-
labels:
171-
type: noble # Must use this specific worker (needed for USDT functional tests)
172-
env:
173-
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"
174-
175161
task:
176162
name: 'fuzzer,address,undefined,integer, no depends'
177163
<< : *GLOBAL_TASK_TEMPLATE

.github/workflows/ci.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
env:
21-
DANGER_RUN_CI_ON_HOST: 1
2221
CI_FAILFAST_TEST_LEAVE_DANGLING: 1 # GHA does not care about dangling processes and setting this variable avoids killing the CI script itself on error
2322
MAKEJOBS: '-j10'
2423

@@ -81,6 +80,7 @@ jobs:
8180
timeout-minutes: 120
8281

8382
env:
83+
DANGER_RUN_CI_ON_HOST: 1
8484
FILE_ENV: './ci/test/00_setup_env_mac_native.sh'
8585
BASE_ROOT_DIR: ${{ github.workspace }}
8686

@@ -308,3 +308,43 @@ jobs:
308308
BITCOINFUZZ: "${{ github.workspace}}\\src\\fuzz.exe"
309309
shell: cmd
310310
run: py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_seed_corpus
311+
312+
asan-lsan-ubsan-integer-no-depends-usdt:
313+
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
314+
runs-on: ubuntu-24.04 # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools
315+
# No need to run on the read-only mirror, unless it is a PR.
316+
if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request'
317+
timeout-minutes: 120
318+
env:
319+
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"
320+
INSTALL_BCC_TRACING_TOOLS: true
321+
steps:
322+
- name: Checkout
323+
uses: actions/checkout@v4
324+
325+
- name: Set Ccache directory
326+
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
327+
328+
- name: Restore Ccache cache
329+
id: ccache-cache
330+
uses: actions/cache/restore@v4
331+
with:
332+
path: ${{ env.CCACHE_DIR }}
333+
key: ${{ github.job }}-ccache-${{ github.run_id }}
334+
restore-keys: ${{ github.job }}-ccache-
335+
336+
- name: Enable bpfcc script
337+
# In the image build step, no external environment variables are available,
338+
# so any settings will need to be written to the settings env file:
339+
run: sed -i "s|\${INSTALL_BCC_TRACING_TOOLS}|true|g" ./ci/test/00_setup_env_native_asan.sh
340+
341+
- name: CI script
342+
run: ./ci/test_run_all.sh
343+
344+
- name: Save Ccache cache
345+
uses: actions/cache/save@v4
346+
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
347+
with:
348+
path: ${{ env.CCACHE_DIR }}
349+
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
350+
key: ${{ github.job }}-ccache-${{ github.run_id }}

ci/test/00_setup_env_native_asan.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
export LC_ALL=C.UTF-8
88

99
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04"
10-
# Only install BCC tracing packages in Cirrus CI.
11-
if [[ "${CIRRUS_CI}" == "true" ]]; then
10+
11+
# Only install BCC tracing packages in CI. Container has to match the host for BCC to work.
12+
if [[ "${INSTALL_BCC_TRACING_TOOLS}" == "true" ]]; then
13+
# Required for USDT functional tests to run
1214
BPFCC_PACKAGE="bpfcc-tools linux-headers-$(uname --kernel-release)"
1315
export CI_CONTAINER_CAP="--privileged -v /sys/kernel:/sys/kernel:rw"
1416
else

ci/test/02_run_container.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
1616
# System-dependent env vars must be kept as is. So read them from the container.
1717
docker run --rm "${CI_IMAGE_NAME_TAG}" bash -c "env | grep --extended-regexp '^(HOME|PATH|USER)='" | tee --append "/tmp/env-$USER-$CONTAINER_NAME"
1818
echo "Creating $CI_IMAGE_NAME_TAG container to run in"
19+
1920
DOCKER_BUILDKIT=1 docker build \
2021
--file "${BASE_READ_ONLY_DIR}/ci/test_imagefile" \
2122
--build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \
2223
--build-arg "FILE_ENV=${FILE_ENV}" \
2324
--label="${CI_IMAGE_LABEL}" \
2425
--tag="${CONTAINER_NAME}" \
2526
"${BASE_READ_ONLY_DIR}"
27+
2628
docker volume create "${CONTAINER_NAME}_ccache" || true
2729
docker volume create "${CONTAINER_NAME}_depends" || true
2830
docker volume create "${CONTAINER_NAME}_depends_sources" || true

0 commit comments

Comments
 (0)