Compare commits
8 Commits
feature/pr
...
a806874594
| Author | SHA1 | Date | |
|---|---|---|---|
| a806874594 | |||
| 61edc25d50 | |||
| f0d7ec56b3 | |||
| e34b7546a4 | |||
| e12212cd2c | |||
| 104cb98d9e | |||
| 7f59bb7c02 | |||
| 6c0b368f6b |
@@ -4,7 +4,7 @@ on: [push]
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -l {0}
|
||||
shell: bash -el {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,37 @@ jobs:
|
||||
meson compile -C build
|
||||
ninja test -C build
|
||||
|
||||
fuzz:
|
||||
runs-on: brutalisk
|
||||
env:
|
||||
CC: 'clang'
|
||||
CXX: 'clang++'
|
||||
FUZZER_TIMEOUT_S: 300
|
||||
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: |
|
||||
source ./portage/.venv/bin/activate
|
||||
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]
|
||||
@@ -164,5 +191,11 @@ jobs:
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: grep for patterns
|
||||
# negate git grep ret code because 1 means no findings
|
||||
run: |
|
||||
git grep -E 'todo!|dbg!' -- '*.rs' && exit 1 || exit 0
|
||||
if git --no-pager grep -E 'todo!|dbg!' -- '*.rs'; then
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
22
scripts/fuzz.sh
Executable file
22
scripts/fuzz.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/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 $?
|
||||
|
||||
if [[ -z "$FUZZER_TIMEOUT_S" ]]; then
|
||||
FUZZER_TIMEOUT_S=600
|
||||
fi
|
||||
|
||||
|
||||
${PROJECT_DIR}/scripts/atom.py <${in} >${out} \
|
||||
| ${PROJECT_DIR}/build/fuzz/atom/parser/fuzzer -max_total_time=$FUZZER_TIMEOUT_S >${in} <${out} \
|
||||
${PROJECT_DIR}/build/atom_parser_fuzzer_corpus \
|
||||
-only_ascii=1 \
|
||||
-timeout=2 \
|
||||
-max_total_time=$FUZZER_TIMEOUT_S \
|
||||
-timeout_exitcode=0 \
|
||||
"$@"
|
||||
Reference in New Issue
Block a user