Skip to content

Commit b031b79

Browse files
committed
[ci] Split out native fuzz jobs for macOS and windows
1 parent 03cff2c commit b031b79

File tree

2 files changed

+68
-8
lines changed

2 files changed

+68
-8
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && CC=clang CXX=clang++ cmake -B build -DWERROR=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWITH_BDB=ON -DWITH_USDT=ON -DCMAKE_CXX_FLAGS='-Wno-error=unused-member-function' && cmake --build build -j $(nproc) && ctest --output-on-failure --test-dir build -j $(nproc) && ./build/test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
7676
7777
macos-native-arm64:
78-
name: 'macOS 14 native, arm64, no depends, sqlite only, gui'
78+
name: ${{ matrix.job-name }}
7979
# Use latest image, but hardcode version to avoid silent upgrades (and breaks).
8080
# See: https://github.com/actions/runner-images#available-images.
8181
runs-on: macos-14
@@ -85,9 +85,20 @@ jobs:
8585

8686
timeout-minutes: 120
8787

88+
strategy:
89+
fail-fast: false
90+
matrix:
91+
job-type: [standard, fuzz]
92+
include:
93+
- job-type: standard
94+
file-env: './ci/test/00_setup_env_mac_native.sh'
95+
job-name: 'macOS 14 native, arm64, no depends, sqlite only, gui'
96+
- job-type: fuzz
97+
file-env: './ci/test/00_setup_env_mac_native_fuzz.sh'
98+
job-name: 'macOS 14 native, arm64, fuzz'
99+
88100
env:
89101
DANGER_RUN_CI_ON_HOST: 1
90-
FILE_ENV: './ci/test/00_setup_env_mac_native.sh'
91102
BASE_ROOT_DIR: ${{ github.workspace }}
92103

93104
steps:
@@ -115,22 +126,24 @@ jobs:
115126
uses: actions/cache/restore@v4
116127
with:
117128
path: ${{ env.CCACHE_DIR }}
118-
key: ${{ github.job }}-ccache-${{ github.run_id }}
119-
restore-keys: ${{ github.job }}-ccache-
129+
key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}
130+
restore-keys: ${{ github.job }}-${{ matrix.job-type }}-ccache-
120131

121132
- name: CI script
122133
run: ./ci/test_run_all.sh
134+
env:
135+
FILE_ENV: ${{ matrix.file-env }}
123136

124137
- name: Save Ccache cache
125138
uses: actions/cache/save@v4
126139
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
127140
with:
128141
path: ${{ env.CCACHE_DIR }}
129142
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
130-
key: ${{ github.job }}-ccache-${{ github.run_id }}
143+
key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}
131144

132145
win64-native:
133-
name: 'Win64 native, VS 2022'
146+
name: ${{ matrix.job-name }}
134147
# Use latest image, but hardcode version to avoid silent upgrades (and breaks).
135148
# See: https://github.com/actions/runner-images#available-images.
136149
runs-on: windows-2022
@@ -142,6 +155,18 @@ jobs:
142155
PYTHONUTF8: 1
143156
TEST_RUNNER_TIMEOUT_FACTOR: 40
144157

158+
strategy:
159+
fail-fast: false
160+
matrix:
161+
job-type: [standard, fuzz]
162+
include:
163+
- job-type: standard
164+
generate-options: '-DBUILD_GUI=ON -DWITH_BDB=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DWERROR=ON'
165+
job-name: 'Win64 native, VS 2022'
166+
- job-type: fuzz
167+
generate-options: '-DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="sqlite" -DBUILD_GUI=OFF -DBUILD_FOR_FUZZING=ON -DWERROR=ON'
168+
job-name: 'Win64 native fuzz, VS 2022'
169+
145170
steps:
146171
- name: Checkout
147172
uses: actions/checkout@v4
@@ -182,11 +207,11 @@ jobs:
182207

183208
- name: Generate build system
184209
run: |
185-
cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DBUILD_GUI=ON -DWITH_BDB=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON
210+
cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" ${{ matrix.generate-options }}
186211
187212
- name: Save vcpkg binary cache
188213
uses: actions/cache/save@v4
189-
if: github.event_name != 'pull_request' && steps.vcpkg-binary-cache.outputs.cache-hit != 'true'
214+
if: github.event_name != 'pull_request' && steps.vcpkg-binary-cache.outputs.cache-hit != 'true' && matrix.job-type == 'standard'
190215
with:
191216
path: ~/AppData/Local/vcpkg/archives
192217
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}
@@ -197,11 +222,13 @@ jobs:
197222
cmake --build . -j $env:NUMBER_OF_PROCESSORS --config Release
198223
199224
- name: Run test suite
225+
if: matrix.job-type == 'standard'
200226
working-directory: build
201227
run: |
202228
ctest --output-on-failure -j $env:NUMBER_OF_PROCESSORS -C Release
203229
204230
- name: Run functional tests
231+
if: matrix.job-type == 'standard'
205232
working-directory: build
206233
env:
207234
BITCOIND: '${{ github.workspace }}\build\src\Release\bitcoind.exe'
@@ -212,6 +239,23 @@ jobs:
212239
shell: cmd
213240
run: py -3 test\functional\test_runner.py --jobs %NUMBER_OF_PROCESSORS% --ci --quiet --tmpdirprefix=%RUNNER_TEMP% --combinedlogslen=99999999 --timeout-factor=%TEST_RUNNER_TIMEOUT_FACTOR% %TEST_RUNNER_EXTRA%
214241

242+
- name: Clone corpora
243+
if: matrix.job-type == 'fuzz'
244+
run: |
245+
git clone --depth=1 https://github.com/bitcoin-core/qa-assets "$env:RUNNER_TEMP\qa-assets"
246+
Set-Location "$env:RUNNER_TEMP\qa-assets"
247+
Write-Host "Using qa-assets repo from commit ..."
248+
git log -1
249+
250+
- name: Run fuzz tests
251+
if: matrix.job-type == 'fuzz'
252+
working-directory: build
253+
env:
254+
BITCOINFUZZ: '${{ github.workspace }}\build\src\test\fuzz\Release\fuzz.exe'
255+
shell: cmd
256+
run: |
257+
py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_corpora
258+
215259
asan-lsan-ubsan-integer-no-depends-usdt:
216260
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
217261
runs-on: ubuntu-24.04 # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
7+
export LC_ALL=C.UTF-8
8+
9+
export CMAKE_GENERATOR="Ninja"
10+
export BITCOIN_CONFIG="-DBUILD_FOR_FUZZING=ON"
11+
export CI_OS_NAME="macos"
12+
export NO_DEPENDS=1
13+
export OSX_SDK=""
14+
export RUN_UNIT_TESTS=false
15+
export RUN_FUNCTIONAL_TESTS=false
16+
export RUN_FUZZ_TESTS=true

0 commit comments

Comments
 (0)