Skip to content

Publish to ARFuzz

Publish to ARFuzz #29

Workflow file for this run

name: Publish to ARFuzz
on:
workflow_call:
workflow_dispatch:
jobs:
solfuzz-build-and-publish:
timeout-minutes: 30
runs-on:
# group: github-v1 #CHANGEME back after testing in fork
ubuntu-latest
env:
MACHINE: linux_clang_haswell
OBJ_DIR: build/linux/clang/haswell
COV_BUILD_DIR: cov
COV_OBJ_DIR: build/cov
EXTRAS: fuzz asan
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- run: sudo apt update && sudo apt install -y zip
- uses: asymmetric-research/clusterfuzz-fuzzbot-builder@main
name: Build shared object (+asan) for fd_exec_sol_compat*.so
with:
command: make -j -Otarget lib
- uses: asymmetric-research/clusterfuzz-fuzzbot-builder@main
name: Build shared objects with coverage enabled
env:
BUILDDIR: ${{ env.COV_BUILD_DIR }}
EXTRAS: fuzz llvm-cov
MACHINE: linux_clang_haswell
with:
command: make -j -Otarget lib
- name: List Artifacts, copy sources
run: |
ls ${{ env.OBJ_DIR }}/lib
ls ${{ env.COV_OBJ_DIR}}/lib
cd src && pwd > buildpwd && cd -
# we give it this path so that the glob hits.
git config --global --add safe.directory /github/workspace/${{ env.OBJ_DIR}}/lib
cp -r src/ ${{ env.COV_OBJ_DIR}}/lib/libfd_exec_sol_compat_src/
# rename the coverage .so's so they don't overwrite on unpack.
mv ${{ env.COV_OBJ_DIR }}/lib/libfd_exec_sol_compat.so ${{ env.COV_OBJ_DIR }}/lib/libfd_exec_sol_compat_cov.so
# also the stubbed target
mv ${{ env.COV_OBJ_DIR }}/lib/libfd_exec_sol_compat_stubbed.so ${{ env.COV_OBJ_DIR }}/lib/libfd_exec_sol_compat_stubbed_cov.so
ls ${{ env.COV_OBJ_DIR}}/lib
- name: upload so artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ env.OBJ_DIR }}/lib/libfd_exec_sol_compat*.so
name: libfd_exec_sol_compat
retention-days: 14
- name: upload .so with cov
uses: actions/upload-artifact@v4
with:
path: ${{ env.COV_OBJ_DIR }}/lib/libfd_exec_sol_compat* # includes ${{ env.COV_OBJ_DIR}}/lib/libfd_exec_sol_compat_src/
name: libfd_exec_sol_compat_cov
retention-days: 14
ARfuzz-publish:
timeout-minutes: 30
strategy:
matrix:
machine:
- linux_clang_haswell
# - linux_clang_icelake # turn off icelake for now
include:
- machine: linux_clang_haswell
artifact_dir: build/linux/clang/haswell
qualifier: modern
# - machine: linux_clang_icelake
# artifact_dir: build/linux/clang/icelake
# qualifier: highend
runs-on:
group: github-v1
env:
MACHINE: ${{ matrix.machine }}
EXTRAS: fuzz asan ubsan
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# - uses: ./.github/actions/deps
- run: sudo apt update && sudo apt install -y zip
- uses: asymmetric-research/clusterfuzz-fuzzbot-builder@main
name: Build M1 fuzz tests
with:
command: make -j -Otarget fuzz-test
- name: List compiled binary directory structure
run: |
ls ${{ matrix.artifact_dir }}/fuzz-test
ls ${{ matrix.artifact_dir }}/lib
- uses: actions/upload-artifact@v4
name: Zip and upload to GitHub Artifacts
id: artifact-zip-m1
with:
path: ${{ matrix.artifact_dir }}
name: "artifact-${{ matrix.machine }}-${{github.run_id}}"
retention-days: 10
- name: Get commit hash
id: get_commit_hash
shell: bash
run: |
echo "commit_hash=$(git rev-parse HEAD 2>/dev/null)" >> $GITHUB_OUTPUT
- name: dispatch AR fuzz bundler
run: |
curl -L \
-X POST \
https://api.github.com/repos/asymmetric-research/FuzzCorp-bundler/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
--data '{"event_type": "fd_main", "client_payload":{"artifact_id": "${{steps.artifact-zip-m1.outputs.artifact-id }}", "bundle_type": "${{ matrix.qualifier }}", "hash":"${{ steps.get_commit_hash.outputs.commit_hash }}", "run_id":"${{ github.run_id}}", "name":"artifact-${{ matrix.machine }}-${{github.run_id}}"}}'