Skip to content

Commit 12f8a7d

Browse files
committed
chore: add a fuzzing workflow
1 parent 2d6067e commit 12f8a7d

1 file changed

Lines changed: 77 additions & 0 deletions

File tree

.github/workflows/fuzzing.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Fuzzing
2+
on:
3+
# Uncomment to enable scheduled runs.
4+
#schedule:
5+
# Run every day at 22 CET
6+
# - cron: '0 21 * * *'
7+
8+
pull_request:
9+
branches: [ main ]
10+
11+
merge_group:
12+
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
21+
build_and_test:
22+
runs-on: ${{ matrix.os }}
23+
name: Fuzzing
24+
strategy:
25+
matrix:
26+
os: [ubuntu-22.04, macos-14]
27+
jdk: [21, 8]
28+
include:
29+
- jdk: 21
30+
# Workaround for https://github.com/bazelbuild/bazel/issues/14502
31+
extra_bazel_args: "--jvmopt=-Djava.security.manager=allow"
32+
- os: ubuntu-22.04
33+
arch: "linux"
34+
- os: macos-14
35+
arch: "macos-arm64"
36+
bazel_args: "--xcode_version_config=//.github:host_xcodes"
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Set up JDK
42+
uses: actions/setup-java@v4
43+
with:
44+
distribution: zulu
45+
java-version: 21
46+
47+
- name: Set Build Buddy config
48+
run: .github/scripts/echoBuildBuddyConfig.sh ${{ secrets.BUILDBUDDY_API_KEY }} >> $GITHUB_ENV
49+
shell: bash
50+
51+
- name: Cache Fuzzing Corpus
52+
uses: actions/cache@v4
53+
with:
54+
path: |
55+
selffuzz/src/test/resources/.corpus
56+
57+
key: fuzzing-corpus-${{ matrix.os }}-${{ matrix.jdk }}-${{ github.run_id }}-${{ github.run_attempt }}
58+
restore-keys: |
59+
fuzzing-corpus-
60+
61+
- name: Build & Fuzz
62+
run: |
63+
bazelisk run ${{env.BUILD_BUDDY_CONFIG}} --java_runtime_version=remotejdk_${{ matrix.jdk }} ${{ matrix.bazel_args }} ${{ matrix.extra_bazel_args }} //selffuzz/src/test/java/com/code_intelligence/selffuzz/mutation:ArgumentsMutatorFuzzTest --jvmopt=-Xmx10000m -- -runs=1000000
64+
65+
# Notification job that runs after all matrix jobs complete
66+
notification:
67+
needs: build_and_test
68+
runs-on: ubuntu-24.04
69+
if: failure() # Run regardless of build_and_test outcome
70+
steps:
71+
- name: Slack notification on failure
72+
run: |
73+
curl -X POST -H 'Content-type: application/json' \
74+
--data '{
75+
"workflow_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
76+
}' \
77+
${{ secrets.SLACK_WEBHOOK_URL }}

0 commit comments

Comments
 (0)