def checkout_steps(api):
  """Run the steps to obtain a checkout of Skia."""
  gclient_cfg = api.gclient.make_config(CACHE_DIR=None)
  skia = gclient_cfg.solutions.add()
  skia.name = 'skia'
  skia.managed = False
  skia.url = 'https://skia.googlesource.com/skia.git'
  skia.revision = api.properties.get('revision') or 'origin/master'
  api.skia.update_repo(skia)

  # Run 'gclient sync'.
  gclient_cfg.got_revision_mapping['skia'] = 'got_revision'
  gclient_cfg.target_os.add('llvm')
  update_step = api.gclient.checkout(gclient_config=gclient_cfg)

  got_revision = update_step.presentation.properties['got_revision']
  api.tryserver.maybe_apply_issue()
  return got_revision