xref: /freebsd/contrib/libfido2/.github/workflows/cifuzz_oss.yml (revision 60a517b66a69b8c011b04063ef63a938738719bd)
1*60a517b6SEd Maste# Copyright (c) 2022 Yubico AB. All rights reserved.
2*60a517b6SEd Maste# Use of this source code is governed by a BSD-style
3*60a517b6SEd Maste# license that can be found in the LICENSE file.
4*60a517b6SEd Maste# SPDX-License-Identifier: BSD-2-Clause
5*60a517b6SEd Maste
6*60a517b6SEd Mastename: cifuzz
7*60a517b6SEd Maste
8*60a517b6SEd Masteon:
9*60a517b6SEd Maste  pull_request:
10*60a517b6SEd Maste    branches:
11*60a517b6SEd Maste    - main
12*60a517b6SEd Maste  push:
13*60a517b6SEd Maste    branches:
14*60a517b6SEd Maste    - main
15*60a517b6SEd Maste    - '*-ci'
16*60a517b6SEd Maste
17*60a517b6SEd Mastejobs:
18*60a517b6SEd Maste  fuzzing:
19*60a517b6SEd Maste    if: github.repository == 'Yubico/libfido2'
20*60a517b6SEd Maste    runs-on: ubuntu-20.04
21*60a517b6SEd Maste    strategy:
22*60a517b6SEd Maste      fail-fast: false
23*60a517b6SEd Maste      matrix:
24*60a517b6SEd Maste        sanitizer: [address, undefined, memory]
25*60a517b6SEd Maste    steps:
26*60a517b6SEd Maste    - name: build fuzzers (${{ matrix.sanitizer }})
27*60a517b6SEd Maste      uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
28*60a517b6SEd Maste      with:
29*60a517b6SEd Maste        oss-fuzz-project-name: 'libfido2'
30*60a517b6SEd Maste        language: c
31*60a517b6SEd Maste        sanitizer: ${{ matrix.sanitizer }}
32*60a517b6SEd Maste        dry-run: false
33*60a517b6SEd Maste    - name: run fuzzers (${{ matrix.sanitizer }})
34*60a517b6SEd Maste      uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
35*60a517b6SEd Maste      with:
36*60a517b6SEd Maste        oss-fuzz-project-name: 'libfido2'
37*60a517b6SEd Maste        language: c
38*60a517b6SEd Maste        sanitizer: ${{ matrix.sanitizer }}
39*60a517b6SEd Maste        fuzz-seconds: 600
40*60a517b6SEd Maste        dry-run: false
41*60a517b6SEd Maste    - name: upload crash
42*60a517b6SEd Maste      uses: actions/upload-artifact@v3
43*60a517b6SEd Maste      if: failure()
44*60a517b6SEd Maste      with:
45*60a517b6SEd Maste        name: ${{ matrix.sanitizer }}-artifacts
46*60a517b6SEd Maste        path: ./out/artifacts
47