From 55a4e1d88af237384189a20ec2aa469ac3bad290 Mon Sep 17 00:00:00 2001 From: Abhishek Arya Date: Mon, 13 Jul 2020 14:50:16 -0700 Subject: [PATCH] Add CIFuzz documentation on how to run jobs on certain branches, paths (#4113) --- .../getting-started/continuous_integration.md | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/docs/getting-started/continuous_integration.md b/docs/getting-started/continuous_integration.md index fc9640262..0ebe5d1b1 100644 --- a/docs/getting-started/continuous_integration.md +++ b/docs/getting-started/continuous_integration.md @@ -79,7 +79,6 @@ jobs: ``` - ### Optional configuration #### Configurable Variables @@ -136,6 +135,54 @@ jobs: {% endraw %} ``` +#### Branches and paths + +You can make CIFuzz trigger only on certain branches or paths by following the +instructions [here](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions). +For example, the following code can used to trigger CIFuzz only on changes to +C/C++ code residing on master and release branches: + +```yaml +name: CIFuzz +on: + pull_request: + branches: + - master + - 'releases/**' + paths: + - '**.c' + - '**.cc' + - '**.cpp' + - '**.cxx' + - '**.h' +jobs: + Fuzzing: + runs-on: ubuntu-latest + steps: + - name: Build Fuzzers + id: build + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + with: + oss-fuzz-project-name: 'example' + dry-run: false + - name: Run Fuzzers + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + with: + oss-fuzz-project-name: 'example' + fuzz-seconds: 600 + dry-run: false + - name: Upload Crash + uses: actions/upload-artifact@v1 + if: failure() && steps.build.outcome == 'success' + with: + name: artifacts + path: ./out/artifacts +``` + +You can checkout CIFuzz configs for OSS-Fuzz projects. Example - +[systemd](https://github.com/systemd/systemd/blob/master/.github/workflows/cifuzz.yml), +[curl](https://github.com/curl/curl/blob/master/.github/workflows/fuzz.yml). + ## Understanding results The results of CIFuzz can be found in two different places.