mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
[ci] Split out native fuzz jobs for macOS and windows
This commit is contained in:
parent
03cff2c142
commit
b031b7910d
2 changed files with 68 additions and 8 deletions
60
.github/workflows/ci.yml
vendored
60
.github/workflows/ci.yml
vendored
|
@ -75,7 +75,7 @@ jobs:
|
||||||
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 }}
|
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 }}
|
||||||
|
|
||||||
macos-native-arm64:
|
macos-native-arm64:
|
||||||
name: 'macOS 14 native, arm64, no depends, sqlite only, gui'
|
name: ${{ matrix.job-name }}
|
||||||
# Use latest image, but hardcode version to avoid silent upgrades (and breaks).
|
# Use latest image, but hardcode version to avoid silent upgrades (and breaks).
|
||||||
# See: https://github.com/actions/runner-images#available-images.
|
# See: https://github.com/actions/runner-images#available-images.
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
|
@ -85,9 +85,20 @@ jobs:
|
||||||
|
|
||||||
timeout-minutes: 120
|
timeout-minutes: 120
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
job-type: [standard, fuzz]
|
||||||
|
include:
|
||||||
|
- job-type: standard
|
||||||
|
file-env: './ci/test/00_setup_env_mac_native.sh'
|
||||||
|
job-name: 'macOS 14 native, arm64, no depends, sqlite only, gui'
|
||||||
|
- job-type: fuzz
|
||||||
|
file-env: './ci/test/00_setup_env_mac_native_fuzz.sh'
|
||||||
|
job-name: 'macOS 14 native, arm64, fuzz'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DANGER_RUN_CI_ON_HOST: 1
|
DANGER_RUN_CI_ON_HOST: 1
|
||||||
FILE_ENV: './ci/test/00_setup_env_mac_native.sh'
|
|
||||||
BASE_ROOT_DIR: ${{ github.workspace }}
|
BASE_ROOT_DIR: ${{ github.workspace }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -115,11 +126,13 @@ jobs:
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ env.CCACHE_DIR }}
|
path: ${{ env.CCACHE_DIR }}
|
||||||
key: ${{ github.job }}-ccache-${{ github.run_id }}
|
key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}
|
||||||
restore-keys: ${{ github.job }}-ccache-
|
restore-keys: ${{ github.job }}-${{ matrix.job-type }}-ccache-
|
||||||
|
|
||||||
- name: CI script
|
- name: CI script
|
||||||
run: ./ci/test_run_all.sh
|
run: ./ci/test_run_all.sh
|
||||||
|
env:
|
||||||
|
FILE_ENV: ${{ matrix.file-env }}
|
||||||
|
|
||||||
- name: Save Ccache cache
|
- name: Save Ccache cache
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
|
@ -127,10 +140,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
path: ${{ env.CCACHE_DIR }}
|
path: ${{ env.CCACHE_DIR }}
|
||||||
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
|
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
|
||||||
key: ${{ github.job }}-ccache-${{ github.run_id }}
|
key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}
|
||||||
|
|
||||||
win64-native:
|
win64-native:
|
||||||
name: 'Win64 native, VS 2022'
|
name: ${{ matrix.job-name }}
|
||||||
# Use latest image, but hardcode version to avoid silent upgrades (and breaks).
|
# Use latest image, but hardcode version to avoid silent upgrades (and breaks).
|
||||||
# See: https://github.com/actions/runner-images#available-images.
|
# See: https://github.com/actions/runner-images#available-images.
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
|
@ -142,6 +155,18 @@ jobs:
|
||||||
PYTHONUTF8: 1
|
PYTHONUTF8: 1
|
||||||
TEST_RUNNER_TIMEOUT_FACTOR: 40
|
TEST_RUNNER_TIMEOUT_FACTOR: 40
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
job-type: [standard, fuzz]
|
||||||
|
include:
|
||||||
|
- job-type: standard
|
||||||
|
generate-options: '-DBUILD_GUI=ON -DWITH_BDB=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DWERROR=ON'
|
||||||
|
job-name: 'Win64 native, VS 2022'
|
||||||
|
- job-type: fuzz
|
||||||
|
generate-options: '-DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="sqlite" -DBUILD_GUI=OFF -DBUILD_FOR_FUZZING=ON -DWERROR=ON'
|
||||||
|
job-name: 'Win64 native fuzz, VS 2022'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
@ -182,11 +207,11 @@ jobs:
|
||||||
|
|
||||||
- name: Generate build system
|
- name: Generate build system
|
||||||
run: |
|
run: |
|
||||||
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
|
cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" ${{ matrix.generate-options }}
|
||||||
|
|
||||||
- name: Save vcpkg binary cache
|
- name: Save vcpkg binary cache
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
if: github.event_name != 'pull_request' && steps.vcpkg-binary-cache.outputs.cache-hit != 'true'
|
if: github.event_name != 'pull_request' && steps.vcpkg-binary-cache.outputs.cache-hit != 'true' && matrix.job-type == 'standard'
|
||||||
with:
|
with:
|
||||||
path: ~/AppData/Local/vcpkg/archives
|
path: ~/AppData/Local/vcpkg/archives
|
||||||
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}
|
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}
|
||||||
|
@ -197,11 +222,13 @@ jobs:
|
||||||
cmake --build . -j $env:NUMBER_OF_PROCESSORS --config Release
|
cmake --build . -j $env:NUMBER_OF_PROCESSORS --config Release
|
||||||
|
|
||||||
- name: Run test suite
|
- name: Run test suite
|
||||||
|
if: matrix.job-type == 'standard'
|
||||||
working-directory: build
|
working-directory: build
|
||||||
run: |
|
run: |
|
||||||
ctest --output-on-failure -j $env:NUMBER_OF_PROCESSORS -C Release
|
ctest --output-on-failure -j $env:NUMBER_OF_PROCESSORS -C Release
|
||||||
|
|
||||||
- name: Run functional tests
|
- name: Run functional tests
|
||||||
|
if: matrix.job-type == 'standard'
|
||||||
working-directory: build
|
working-directory: build
|
||||||
env:
|
env:
|
||||||
BITCOIND: '${{ github.workspace }}\build\src\Release\bitcoind.exe'
|
BITCOIND: '${{ github.workspace }}\build\src\Release\bitcoind.exe'
|
||||||
|
@ -212,6 +239,23 @@ jobs:
|
||||||
shell: cmd
|
shell: cmd
|
||||||
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%
|
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%
|
||||||
|
|
||||||
|
- name: Clone corpora
|
||||||
|
if: matrix.job-type == 'fuzz'
|
||||||
|
run: |
|
||||||
|
git clone --depth=1 https://github.com/bitcoin-core/qa-assets "$env:RUNNER_TEMP\qa-assets"
|
||||||
|
Set-Location "$env:RUNNER_TEMP\qa-assets"
|
||||||
|
Write-Host "Using qa-assets repo from commit ..."
|
||||||
|
git log -1
|
||||||
|
|
||||||
|
- name: Run fuzz tests
|
||||||
|
if: matrix.job-type == 'fuzz'
|
||||||
|
working-directory: build
|
||||||
|
env:
|
||||||
|
BITCOINFUZZ: '${{ github.workspace }}\build\src\test\fuzz\Release\fuzz.exe'
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_corpora
|
||||||
|
|
||||||
asan-lsan-ubsan-integer-no-depends-usdt:
|
asan-lsan-ubsan-integer-no-depends-usdt:
|
||||||
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
|
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
|
||||||
runs-on: ubuntu-24.04 # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools
|
runs-on: ubuntu-24.04 # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools
|
||||||
|
|
16
ci/test/00_setup_env_mac_native_fuzz.sh
Executable file
16
ci/test/00_setup_env_mac_native_fuzz.sh
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Copyright (c) The Bitcoin Core developers
|
||||||
|
# Distributed under the MIT software license, see the accompanying
|
||||||
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
|
export CMAKE_GENERATOR="Ninja"
|
||||||
|
export BITCOIN_CONFIG="-DBUILD_FOR_FUZZING=ON"
|
||||||
|
export CI_OS_NAME="macos"
|
||||||
|
export NO_DEPENDS=1
|
||||||
|
export OSX_SDK=""
|
||||||
|
export RUN_UNIT_TESTS=false
|
||||||
|
export RUN_FUNCTIONAL_TESTS=false
|
||||||
|
export RUN_FUZZ_TESTS=true
|
Loading…
Add table
Reference in a new issue