aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2020-06-16 18:24:48 +0300
committerGitHub <noreply@github.com>2020-06-16 08:24:48 -0700
commitd9c7f893f3e35757298e1cc9e5e8b7f7fb65fffb (patch)
treea9a5528673bcb87cddfbd670970dde0bca150225 /docs
parente4420e001d5aa37ffc57c4acb2d9d4a7929fb604 (diff)
downloadoss-fuzz-d9c7f893f3e35757298e1cc9e5e8b7f7fb65fffb.tar.gz
[docs] switch to a matrix in the "sanitizer" example (#3984)
This was discussed in https://github.com/google/oss-fuzz/pull/3969#discussion_r439145136
Diffstat (limited to 'docs')
-rw-r--r--docs/getting-started/continuous_integration.md56
1 files changed, 17 insertions, 39 deletions
diff --git a/docs/getting-started/continuous_integration.md b/docs/getting-started/continuous_integration.md
index d536ea9be..8a544b481 100644
--- a/docs/getting-started/continuous_integration.md
+++ b/docs/getting-started/continuous_integration.md
@@ -95,64 +95,42 @@ make sure to set the dry-run parameters in both the `Build Fuzzers` and `Run Fuz
limit for broken fuzz targets than OSS-Fuzz's check_build. Most users should
not set this.
-#### Adding Other Sanitizers
-CIFuzz supports address, memory and undefined sanitizers. Address is the default
-sanitizer and will be used for every job in which a sanitizer is not specified.
-To add another sanitizer to your workflow copy the `Fuzzing` job and rename it
-to the sanitizer you want to fuzz with. Then add the sanitizer variable to both
-the `Build Fuzzers` step and the `Run Fuzzers` step. The choices are `'address'`,
-`'memory'`, and `'undefined'`. Once this additional job is configured the CIFuzz
-workflow will run all of the jobs corresponding to each sanitizer simultaneously.
-It is important to note that the `Build Fuzzers` and the `Run Fuzzers` sanitizer
-field needs to be the same. See the following main.yml file for an example.
+`sanitizer`: Determines a sanitizer to build and run fuzz targets with. The choices are `'address'`,
+`'memory'` and `'undefined'`. The default is `'address'`. It is important to note that the `Build Fuzzers`
+and the `Run Fuzzers` sanitizer field needs to be the same. To specify a list of sanitizers
+a [matrix](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix)
+can be used. To use a sanitizer add it to the list of sanitizers in the matrix field below:
```yaml
name: CIFuzz
on: [pull_request]
jobs:
- AddressFuzzing:
- runs-on: ubuntu-latest
- steps:
- - name: Build Fuzzers
- uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
- with:
- oss-fuzz-project-name: 'example'
- dry-run: false
- # sanitizer: address
- - 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
- # sanitizer: address
- - name: Upload Crash
- uses: actions/upload-artifact@v1
- if: failure()
- with:
- name: Address-Artifacts
- path: ./out/artifacts
- UndefinedFuzzing:
+ Fuzzing:
runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ sanitizer: [address, undefined, memory]
steps:
- - name: Build Fuzzers
+ - name: Build Fuzzers (${{ matrix.sanitizer }})
+ id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'example'
dry-run: false
- sanitizer: 'undefined'
- - name: Run Fuzzers
+ sanitizer: ${{ matrix.sanitizer }}
+ - name: Run Fuzzers (${{ matrix.sanitizer }})
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'example'
fuzz-seconds: 600
dry-run: false
- sanitizer: 'undefined'
+ sanitizer: ${{ matrix.sanitizer }}
- name: Upload Crash
uses: actions/upload-artifact@v1
- if: failure()
+ if: failure() && steps.build.outcome == 'success'
with:
- name: Undefined-Artifacts
+ name: ${{ matrix.sanitizer }}-artifacts
path: ./out/artifacts
```