Home | History | Annotate | Download | only in recipes
      1 # Copyright 2014 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 
      6 # Recipe for the Skia PerCommit Housekeeper.
      7 
      8 DEPS = [
      9   'depot_tools/bot_update',
     10   'recipe_engine/context',
     11   'recipe_engine/path',
     12   'recipe_engine/properties',
     13   'recipe_engine/python',
     14   'recipe_engine/step',
     15   'core',
     16   'run',
     17   'vars',
     18 ]
     19 
     20 
     21 def RunSteps(api):
     22   # Checkout, compile, etc.
     23   api.core.setup()
     24 
     25   cwd = api.path['checkout']
     26 
     27   # TODO(borenet): Detect static initializers?
     28 
     29   with api.context(cwd=cwd):
     30     gsutil_path = api.bot_update._module.PACKAGE_REPO_ROOT.join('gsutil.py')
     31     if not api.vars.is_trybot:
     32       api.run(
     33         api.step,
     34         'generate and upload doxygen',
     35         cmd=['python', api.core.resource('generate_and_upload_doxygen.py')],
     36         abort_on_failure=False)
     37 
     38     cmd = ['python', api.core.resource('run_binary_size_analysis.py'),
     39            '--library', api.vars.skia_out.join(
     40                'Release', 'lib', 'libskia.so'),
     41            '--githash', api.properties['revision'],
     42            '--gsutil_path', gsutil_path]
     43     if api.vars.is_trybot:
     44       cmd.extend(['--issue_number', str(api.properties['patch_issue'])])
     45     api.run(
     46       api.step,
     47       'generate and upload binary size data',
     48       cmd=cmd,
     49       abort_on_failure=False)
     50 
     51 
     52 def GenTests(api):
     53   yield (
     54       api.test('Housekeeper-PerCommit') +
     55       api.properties(buildername='Housekeeper-PerCommit',
     56                      repository='https://skia.googlesource.com/skia.git',
     57                      revision='abc123',
     58                      path_config='kitchen',
     59                      swarm_out_dir='[SWARM_OUT_DIR]') +
     60       api.path.exists(api.path['start_dir'])
     61   )
     62   yield (
     63       api.test('Housekeeper-PerCommit-Trybot') +
     64       api.properties(buildername='Housekeeper-PerCommit',
     65                      repository='https://skia.googlesource.com/skia.git',
     66                      revision='abc123',
     67                      path_config='kitchen',
     68                      patch_storage='gerrit',
     69                      swarm_out_dir='[SWARM_OUT_DIR]') +
     70       api.properties.tryserver(
     71           buildername='Housekeeper-PerCommit',
     72           gerrit_project='skia',
     73           gerrit_url='https://skia-review.googlesource.com/',
     74       ) +
     75       api.path.exists(api.path['start_dir'])
     76   )
     77