[infra] Set OSS_FUZZ_CI=1 in CI so build scripts can know (#5731)

This will help bitcoin use CI to verify the build works, because
the last step is trivial (so testing not really needed) but will
fill up the disk.
This commit is contained in:
jonathanmetzman 2021-05-07 07:46:11 -07:00 committed by GitHub
parent f1cb756452
commit 033a858be0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -239,6 +239,7 @@ def build_canary_project():
def main():
"""Build modified projects or canary project."""
os.environ['OSS_FUZZ_CI'] = '1'
infra_changed = is_infra_changed()
if infra_changed:
print('Pulling and building base images first.')

View File

@ -554,6 +554,8 @@ def build_fuzzers_impl( # pylint: disable=too-many-arguments,too-many-locals,to
'ARCHITECTURE=' + architecture,
]
_add_oss_fuzz_ci_if_needed(env)
if project_language:
env.append('FUZZING_LANGUAGE=' + project_language)
@ -621,6 +623,13 @@ def build_fuzzers(args):
args.source_path)
def _add_oss_fuzz_ci_if_needed(env):
"""Adds value of |OSS_FUZZ_CI| environment variable to |env| if it is set."""
oss_fuzz_ci = os.getenv('OSS_FUZZ_CI')
if oss_fuzz_ci:
env.append('OSS_FUZZ_CI=' + oss_fuzz_ci)
def check_build(args):
"""Checks that fuzzers in the container execute without errors."""
if not check_project_exists(args.project_name):
@ -641,6 +650,7 @@ def check_build(args):
'ARCHITECTURE=' + args.architecture,
'FUZZING_LANGUAGE=' + fuzzing_language,
]
_add_oss_fuzz_ci_if_needed(env)
if args.e:
env += args.e