ci: add roundtrip_ellswift #219
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Checkout bitcoinfuzz repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: bitcoinfuzz/bitcoinfuzz | |
| path: bitcoinfuzz | |
| submodules: recursive | |
| - name: Install rust-toolchain | |
| uses: actions-rs/toolchain@v1.0.6 | |
| with: | |
| toolchain: nightly | |
| - name: Install go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "stable" | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: "temurin" | |
| java-version: "21" | |
| - name: Install .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "9.0.x" | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y lowdown libsodium-dev libboost-all-dev | |
| - name: Setup common environment | |
| run: | | |
| export CC=/usr/bin/clang | |
| export CXX=/usr/bin/clang++ | |
| echo "CC=/usr/bin/clang" >> $GITHUB_ENV | |
| echo "CXX=/usr/bin/clang++" >> $GITHUB_ENV | |
| - name: Save environment variables | |
| run: | | |
| echo "CC=$CC" >> build.env | |
| echo "CXX=$CXX" >> build.env | |
| - name: Setup Python and install embit and pybitcoinkernel | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: | | |
| python -m pip install --upgrade pip | |
| pip install -r bitcoinfuzz/modules/embit/requirements.txt | |
| pip install -r bitcoinfuzz/modules/pybitcoinkernel/requirements.txt | |
| pip install mako | |
| - name: Build Modules | |
| timeout-minutes: 40 | |
| run: | | |
| cd bitcoinfuzz && CXXFLAGS="-DBITCOIN_CORE \ | |
| -DRUST_BITCOIN \ | |
| -DRUSTBITCOINKERNEL \ | |
| -DRUST_MINISCRIPT \ | |
| -DBTCD \ | |
| -DNBITCOIN \ | |
| -DEMBIT \ | |
| -DPYBITCOINKERNEL \ | |
| -DLND \ | |
| -DLDK \ | |
| -DNLIGHTNING \ | |
| -DLIGHTNING_KMP \ | |
| -DBITCOINJ \ | |
| -DCLIGHTNING \ | |
| -DECLAIR \ | |
| -DDECRED_SECP256K1 \ | |
| -DSECP256K1 \ | |
| -DNBITCOIN_SECP256K1 \ | |
| -DRUST_K256 \ | |
| -DCUSTOM_MUTATOR_P2P_MESSAGE \ | |
| -DRUSTREEXO \ | |
| -DUTREEXO" \ | |
| ONLY_MODULES=1 \ | |
| ./auto_build.py | |
| - name: Cache build artifacts | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| bitcoinfuzz | |
| build.env | |
| key: bitcoinfuzz-build-${{ matrix.os }}-${{ github.sha }}-${{ github.run_id }} | |
| test: | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| test: | |
| - corpus: "script" | |
| target: "script" | |
| cxxflags: "-DBITCOIN_CORE -DRUST_BITCOIN" | |
| asan_options: "detect_container_overflow=0" | |
| - corpus: "deserialize_block" | |
| target: "deserialize_block" | |
| cxxflags: "-DBITCOIN_CORE -DRUST_BITCOIN -DBTCD" | |
| asan_options: "" | |
| - corpus: "script_eval" | |
| target: "script_eval" | |
| cxxflags: "-DBITCOIN_CORE -DBTCD -DNBITCOIN" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "verify_script" | |
| target: "verify_script" | |
| cxxflags: "-DBITCOIN_CORE -DBTCD" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "descriptor_parse_clean" | |
| target: "descriptor_parse" | |
| cxxflags: "-DBITCOIN_CORE -DRUST_MINISCRIPT" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "miniscript_parse_clean" | |
| target: "miniscript_parse" | |
| cxxflags: "-DBITCOIN_CORE -DRUST_MINISCRIPT" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "address_parse" | |
| target: "address_parse" | |
| cxxflags: "-DBITCOIN_CORE -DRUST_BITCOIN -DBTCD" | |
| asan_options: "detect_container_overflow=0" | |
| - corpus: "psbt_parse_clean" | |
| target: "psbt_parse" | |
| cxxflags: "-DBITCOIN_CORE -DRUST_BITCOIN -DBTCD -DNBITCOIN" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "kernel_block" | |
| target: "kernel_block" | |
| cxxflags: "-DPYBITCOINKERNEL -DRUSTBITCOINKERNEL" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "cmpctblocks_parse" | |
| target: "cmpctblocks_parse" | |
| cxxflags: "-DBITCOIN_CORE -DRUST_BITCOIN" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "parse_p2p_message" | |
| target: "parse_p2p_message" | |
| cxxflags: "-DRUST_BITCOIN -DBTCD -DCUSTOM_MUTATOR_P2P_MESSAGE" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "deserialize_invoice_clean" | |
| target: "deserialize_invoice" | |
| cxxflags: "-DLDK -DLND -DCLIGHTNING -DECLAIR -DLIGHTNING_KMP -DCUSTOM_MUTATOR_BOLT11" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| setup_java: "true" | |
| - corpus: "deserialize_offer_clean" | |
| target: "deserialize_offer" | |
| cxxflags: "-DLDK -DCLIGHTNING -DECLAIR -DLIGHTNING_KMP -DCUSTOM_MUTATOR_BOLT12_OFFER" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| setup_java: "true" | |
| - corpus: "parse_p2p_lightning_message" | |
| target: "parse_p2p_lightning_message" | |
| cxxflags: "-DLDK -DCLIGHTNING -DLND -DCUSTOM_MUTATOR_P2P_LIGHTNING_MESSAGE" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "bip32_master_keygen" | |
| target: "bip32_master_keygen" | |
| cxxflags: "-DNBITCOIN -DRUST_BITCOIN -DBITCOIN_CORE -DBTCD -DBITCOINJ" | |
| setup_java: "true" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "private_to_public_key" | |
| target: "private_to_public_key" | |
| cxxflags: "-DDECRED_SECP256K1 -DSECP256K1 -DNBITCOIN_SECP256K1 -DRUST_K256" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "sign_compact" | |
| target: "sign_compact" | |
| cxxflags: "-DDECRED_SECP256K1 -DSECP256K1 -DNBITCOIN_SECP256K1 -DRUST_K256" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "sign_der" | |
| target: "sign_der" | |
| cxxflags: "-DDECRED_SECP256K1 -DSECP256K1 -DNBITCOIN_SECP256K1 -DRUST_K256" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "sign_verify" | |
| target: "sign_verify" | |
| cxxflags: "-DDECRED_SECP256K1 -DSECP256K1 -DNBITCOIN_SECP256K1 -DRUST_K256 -DCUSTOM_MUTATOR_SECP256K1_SIGNATURE" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "sign_schnorr" | |
| target: "sign_schnorr" | |
| cxxflags: "-DBTCD -DSECP256K1" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "ecdh" | |
| target: "ecdh" | |
| cxxflags: "-DDECRED_SECP256K1 -DSECP256K1 -DNBITCOIN_SECP256K1 -DRUST_K256" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "decode_ellswift" | |
| target: "decode_ellswift" | |
| cxxflags: "-DBTCD -DSECP256K1" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "stump_modify_add" | |
| target: "stump_modify_add" | |
| cxxflags: "-DRUSTREEXO -DUTREEXO" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "bip32_derive_from_path" | |
| target: "bip32_derive_from_path" | |
| cxxflags: "-DNBITCOIN -DRUST_BITCOIN -DBITCOIN_CORE" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| - corpus: "roundtrip_ellswift" | |
| target: "roundtrip_ellswift" | |
| cxxflags: "-DBTCD -DSECP256K1" | |
| asan_options: "detect_leaks=0:detect_container_overflow=0" | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-test-env | |
| with: | |
| os: ${{ matrix.os }} | |
| github-sha: ${{ github.sha }} | |
| github-run-id: ${{ github.run_id }} | |
| - name: Load environment variables | |
| run: | | |
| if [ -f build.env ]; then | |
| cat build.env >> $GITHUB_ENV | |
| fi | |
| - name: Pre-build step | |
| if: matrix.test.pre_build != '' | |
| timeout-minutes: 5 | |
| run: ${{ matrix.test.pre_build }} | |
| - name: Setup Java | |
| if: matrix.test.setup_java == 'true' | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: "temurin" | |
| java-version: "21" | |
| - name: Test - ${{ matrix.test.target }} | |
| timeout-minutes: 5 | |
| run: | | |
| FUZZ=${{ matrix.test.target }} ./.github/scripts/run-fuzz.sh "${{ matrix.test.corpus }}" "${{ matrix.test.target }}" "${{ matrix.test.cxxflags }}" "${{ matrix.test.asan_options }}" "$CXX" |