aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorFabian Meumertzheim <meumertzheim@code-intelligence.com>2021-08-02 13:40:51 +0200
committerFabian Meumertzheim <fabian@meumertzhe.im>2021-10-18 10:29:07 +0200
commit552123670027e0ccb124c467ae56de92c8e457e9 (patch)
tree14f714351f8170d78728dda10e0b12b361ce50e9 /.github
parent7907a8b9c9b49968adce6623f586240e010da801 (diff)
downloadjazzer-api-552123670027e0ccb124c467ae56de92c8e457e9.tar.gz
Add a stand-alone replayer
The replayer can be used to reproduce crashes for fuzz targets using the FuzzedDataProvider only given the raw crashing input. This will help maintainers of OSS-Fuzz projects to reproduce issues even though they have no access to the Java reproducers, which ClusterFuzz does not store. Compared to the full Jazzer driver, it has the advantage that it is a Java library (with a native library dependency) and can thus be published to Maven. Since we currently do not have multi-platform RBE or cross toolchains set up on GitHub, the packages jars for the individual architectures are merged in a GitHub Actions pipeline.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build-replayer.yml76
1 files changed, 76 insertions, 0 deletions
diff --git a/.github/workflows/build-replayer.yml b/.github/workflows/build-replayer.yml
new file mode 100644
index 00000000..aa617416
--- /dev/null
+++ b/.github/workflows/build-replayer.yml
@@ -0,0 +1,76 @@
+name: Release replayer
+
+on:
+ workflow_dispatch:
+
+jobs:
+
+ build_replayer:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-10.15]
+ include:
+ - os: ubuntu-latest
+ arch: "linux"
+ cache: "/home/runner/.cache/bazel-disk"
+ - os: macos-10.15
+ arch: "darwin"
+ cache: "/private/var/tmp/bazel-disk"
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Set up JDK
+ uses: actions/setup-java@v1
+ with:
+ java-version: 8
+
+ - name: Mount Bazel disk cache
+ uses: actions/cache@v2
+ with:
+ path: ${{ matrix.cache }}
+ key: bazel-disk-cache-${{ matrix.arch }}-8
+
+ - name: Build
+ run: |
+ bazelisk build --config=ci --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }} --disk_cache=${{ matrix.cache }} --java_runtime_version=localjdk_${{ matrix.jdk }} //agent/src/main/java/com/code_intelligence/jazzer/replay:Replayer_deploy.jar
+ cp -L bazel-bin/agent/src/main/java/com/code_intelligence/jazzer/replay/Replayer_deploy.jar replayer.jar
+
+ - name: Upload test logs
+ if: always()
+ uses: actions/upload-artifact@v2
+ with:
+ name: replayer_${{ matrix.arch }}.jar
+ path: replayer.jar
+
+ merge_jars:
+ runs-on: ubuntu-latest
+ needs: build_replayer
+
+ steps:
+ - name: Download macOS jar
+ uses: actions/download-artifact@v2
+ with:
+ name: replayer_darwin.jar
+ path: replayer_darwin
+
+ - name: Download Linux jar
+ uses: actions/download-artifact@v2
+ with:
+ name: replayer_linux.jar
+ path: replayer_linux
+
+ - name: Merge jars
+ run: |
+ mkdir merged
+ unzip -o replayer_darwin/replayer.jar -d merged
+ unzip -o replayer_linux/replayer.jar -d merged
+ jar cvmf merged/META-INF/MANIFEST.MF replayer.jar -C merged .
+
+ - name: Upload merged jar
+ uses: actions/upload-artifact@v2
+ with:
+ name: replayer.jar
+ path: replayer.jar
+