summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/.github/workflows/fuzz.yml
blob: 188a4c79c7d6537af886ef820061a6181172a409 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright (c) the JPEG XL Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

# CI on pull-requests to run the fuzzer from oss-fuzz. See:
#
#   https://google.github.io/oss-fuzz/getting-started/continuous-integration/

name: CIFuzz
on:
  pull_request:
    types: [opened, reopened, synchronize]
    paths:
      - '**.c'
      - '**.cc'
      - '**.cmake'
      - '**.h'
      - '**CMakeLists.txt'
      - .github/workflows/fuzz.yml

concurrency: 
  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  fuzzing:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout source
      uses: actions/checkout@v2
      id: checkout
      with:
        # The build_fuzzers action checks out the code to the storage/libjxl
        # directory already, but doesn't check out the submodules. This step
        # is a workaround for checking out the submodules.
        path: storage/libjxl
        submodules: true
    - name: Build Fuzzers
      id: build
      uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
      with:
        oss-fuzz-project-name: 'libjxl'
        language: c++
    - name: Run Fuzzers
      uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
      with:
        oss-fuzz-project-name: 'libjxl'
        language: c++
        fuzz-seconds: 600
    - name: Upload Crash
      uses: actions/upload-artifact@v1
      if: failure() && steps.build.outcome == 'success'
      with:
        name: artifacts
        path: ./out/artifacts