6 Commits

Author SHA1 Message Date
a1c2fcdc5f ci: fix jobs not exiting on failure
Some checks failed
Gentoo Utils / build-oci-image (push) Successful in 6s
Gentoo Utils / check-format (push) Successful in 7s
Gentoo Utils / docs (push) Successful in 12s
Gentoo Utils / build (push) Successful in 19s
Gentoo Utils / test (push) Successful in 27s
Gentoo Utils / fuzz (push) Failing after 43s
2025-12-13 21:46:59 -06:00
2b133eca35 scripts: fuzzer: add fork count 2025-12-13 21:46:59 -06:00
fe8aa9c452 ci: build: remove debugging echos
ci: build: remove redundant source
2025-12-13 21:46:59 -06:00
297fdecd55 ci: fuzz: add timeout 2025-12-13 21:46:52 -06:00
43441a3943 ci: add fuzzer job 2025-12-13 21:45:33 -06:00
73930ec63d scripts: add fuzzer helper script 2025-12-13 21:22:53 -06:00
2 changed files with 45 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ on: [push]
defaults:
run:
shell: bash -l {0}
shell: bash -le {0}
jobs:
build-oci-image:
@@ -98,10 +98,6 @@ jobs:
- name: build and check
run: |
echo $USER
echo "CC=$CC"
echo "CXX=$CXX"
source /etc/profile
meson setup -Dfuzz=enabled -Dtests=enabled -Dbuildtype=debugoptimized -Ddocs=enabled build
meson compile -C build
@@ -125,6 +121,35 @@ jobs:
meson compile -C build
ninja test -C build
fuzz:
runs-on: brutalisk
env:
CC: 'clang'
CXX: 'clang++'
needs: [build-oci-image, build]
container:
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
steps:
- name: Checkout repo
uses: actions/checkout@v5
# FIXME: Get rid of this step when portage has fixes merged?
# needed because portage has fixes upstream we need that arent stable yet
- name: Checkout tip of portage
run: |
git clone https://github.com/gentoo/portage.git
cd portage
python -m venv .venv && ./venv/bin/pip install -e .
source ./venv/bin/activate
which emerge
- name: build and fuzz
run: |
which emerge
meson setup -Dfuzz=enabled -Dtests=enabled -Dbuildtype=debugoptimized build
meson compile atom_parser_fuzzer:alias -C build
timeout 10m ./scripts/fuzz.sh
check-format:
runs-on: brutalisk
needs: [build-oci-image]

15
scripts/fuzz.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
CWD="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
PROJECT_DIR=$(realpath "${CWD}/../")
in=$(mktemp -u) || exit $?
out=$(mktemp -u) || exit $?
mkfifo ${in} ${out} || exit $?
${PROJECT_DIR}/scripts/atom.py <${in} >${out} \
| ${PROJECT_DIR}/build/fuzz/atom/parser/fuzzer >${in} <${out} \
${PROJECT_DIR}/build/atom_parser_fuzzer_corpus \
-only_ascii=1 \
-fork=$(($(nproc) / 2))
"$@"