Skip to content

Add fuzz inputs

Add fuzz inputs #132

Workflow file for this run

# Copyright (c) The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit.
name: CI
on:
push:
pull_request:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
ci-matrix:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
timeout-minutes: ${{ matrix.timeout-minutes }}
env:
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
DANGER_CI_ON_HOST_FOLDERS: 1
FILE_ENV: ${{ matrix.file-env }}
strategy:
fail-fast: false
matrix:
include:
- name: 'fuzz'
runner: 'ubuntu-latest'
# To catch potential timeouts early, this task must replicate the config from https://github.com/bitcoin/bitcoin/blob/master/.github/workflows/ci.yml
timeout-minutes: 240
file-env: './ci/test/00_setup_env_native_fuzz.sh'
- name: 'fuzz (msan)'
runner: 'ubuntu-latest'
timeout-minutes: 360
file-env: './ci/test/00_setup_env_native_fuzz_with_msan.sh'
- name: 'fuzz (valgrind)'
runner: 'ubuntu-latest'
timeout-minutes: 360
file-env: './ci/test/00_setup_env_native_fuzz_with_valgrind.sh'
steps:
- name: Checkout Bitcoin Core
uses: actions/checkout@v5
with:
repository: bitcoin/bitcoin
fetch-depth: 1
- name: Checkout
uses: actions/checkout@v5
with:
path: qa-assets
fetch-depth: 1
- name: Clear unnecessary files on bloated GHA VM
uses: bitcoin/bitcoin/.github/actions/clear-files@master
- name: Configure environment
uses: bitcoin/bitcoin/.github/actions/configure-environment@master
- name: Restore caches
id: restore-cache
uses: bitcoin/bitcoin/.github/actions/cache/restore@master
- name: Configure Docker
uses: bitcoin/bitcoin/.github/actions/configure-docker@master
- name: CI script
run: |
mkdir -p "./ci/scratch_ ₿🧪_/qa-assets"
mv ./qa-assets/{.git,fuzz_corpora} "./ci/scratch_ ₿🧪_/qa-assets/"
./ci/test_run_all.sh
- name: Save caches
uses: bitcoin/bitcoin/.github/actions/cache/save@master
lint:
name: lint
runs-on: ubuntu-slim
if: github.event_name == 'pull_request'
steps:
- name: Calculate fetch depth
id: vars
run: echo "PR_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: ${{ steps.vars.outputs.PR_DEPTH }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Ensure pull is rebased on current main
run: |
git fetch origin main --depth=1
git merge-base --is-ancestor origin/main ${{ github.event.pull_request.head.sha }}
- name: Install Cargo
run: |
sudo apt-get update
sudo apt-get install -y cargo
- name: Build touched-files-check
working-directory: contrib/touched-files-check
run: cargo build
- name: Fuzz inputs size (git HEAD)
run: du -sh ./fuzz_corpora/
- name: Lint
run: ./contrib/touched-files-check/target/debug/touched-files-check "origin/main..HEAD"
- name: Fuzz inputs size (git origin/main)
run: |
git checkout origin/main
du -sh ./fuzz_corpora/