2020-04-24 13:00:44 +03:00
---
# vi: ts=2 sw=2 et:
2021-10-01 13:10:22 +03:00
# SPDX-License-Identifier: LGPL-2.1-or-later
2020-04-24 13:00:44 +03:00
# See: https://google.github.io/oss-fuzz/getting-started/continuous-integration/
name : CIFuzz
2021-11-13 17:40:20 +03:00
2021-11-14 01:34:04 +03:00
permissions :
contents : read
2021-11-13 17:40:20 +03:00
2020-05-08 19:46:46 +03:00
on :
pull_request :
paths :
- '**/meson.build'
- '.github/workflows/**'
- 'meson_options.txt'
- 'src/**'
- 'test/fuzz/**'
- 'tools/oss-fuzz.sh'
2020-05-08 21:14:19 +03:00
push :
branches :
2021-01-21 16:52:18 +03:00
- main
2020-04-24 13:00:44 +03:00
jobs :
2021-11-10 18:42:07 +03:00
Fuzzing :
2024-06-07 11:55:53 +03:00
# FIXME: Figure out why 32-bit applications fail to run in docker on Ubuntu 24.04.
runs-on : ubuntu-22.04
2021-11-10 18:42:07 +03:00
if : github.repository == 'systemd/systemd'
2021-11-10 18:45:12 +03:00
concurrency :
2022-05-29 17:15:15 +03:00
group : ${{ github.workflow }}-${{ matrix.sanitizer }}-${{ matrix.architecture }}-${{ github.ref }}
2021-11-10 18:45:12 +03:00
cancel-in-progress : true
2021-11-10 18:42:07 +03:00
strategy :
fail-fast : false
matrix :
sanitizer : [ address, undefined, memory]
2022-05-29 17:15:15 +03:00
architecture : [ x86_64]
include :
- sanitizer : address
architecture : i386
2023-06-05 08:37:34 +03:00
permissions :
security-events : write
2021-11-10 18:42:07 +03:00
steps :
2023-08-30 20:58:14 +03:00
- name : Build Fuzzers
2021-11-10 18:42:07 +03:00
id : build
uses : google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with :
oss-fuzz-project-name : 'systemd'
dry-run : false
allowed-broken-targets-percentage : 0
2022-02-11 05:01:33 +03:00
# keep-unaffected-fuzz-targets should be removed once https://github.com/google/oss-fuzz/issues/7011 is fixed
keep-unaffected-fuzz-targets : true
2021-11-10 18:42:07 +03:00
sanitizer : ${{ matrix.sanitizer }}
2022-05-29 17:15:15 +03:00
architecture : ${{ matrix.architecture }}
2023-06-05 08:37:34 +03:00
output-sarif : true
2023-08-30 20:58:14 +03:00
- name : Run Fuzzers
2021-11-10 18:42:07 +03:00
uses : google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with :
oss-fuzz-project-name : 'systemd'
fuzz-seconds : 600
dry-run : false
sanitizer : ${{ matrix.sanitizer }}
2023-06-05 08:37:34 +03:00
output-sarif : true
2021-11-10 18:42:07 +03:00
- name : Upload Crash
2024-03-01 12:18:57 +03:00
uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
2021-11-10 18:42:07 +03:00
if : failure() && steps.build.outcome == 'success'
with :
2022-05-29 17:15:15 +03:00
name : ${{ matrix.sanitizer }}-${{ matrix.architecture }}-artifacts
2021-11-10 18:42:07 +03:00
path : ./out/artifacts
2023-06-05 08:37:34 +03:00
- name : Upload Sarif
if : always() && steps.build.outcome == 'success'
2024-03-13 22:16:26 +03:00
uses : github/codeql-action/upload-sarif@3ab4101902695724f9365a384f86c1074d94e18c
2023-06-05 08:37:34 +03:00
with :
# Path to SARIF file relative to the root of the repository
sarif_file : cifuzz-sarif/results.sarif
checkout_path : cifuzz-sarif