blob: e3a98a6b3736a9c36f5c11f4c8b7c5f24c79c00d [file] [log] [blame]
borenet93408df2016-10-05 06:00:26 -07001# Copyright 2016 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 which runs the Skia presubmit.
7
8
9DEPS = [
borenet3493e172016-10-05 07:29:06 -070010 'depot_tools/depot_tools',
11 'recipe_engine/path',
borenet93408df2016-10-05 06:00:26 -070012 'recipe_engine/properties',
13 'recipe_engine/step',
borenet3493e172016-10-05 07:29:06 -070014 'recipe_engine/uuid',
Eric Boren6441a462017-01-13 13:37:53 -050015 'skia-recipes/core',
16 'skia-recipes/vars',
borenet93408df2016-10-05 06:00:26 -070017]
18
19
20def RunSteps(api):
21 api.vars.setup()
22 api.core.checkout_steps()
borenet3493e172016-10-05 07:29:06 -070023
borenetcd72afa2016-10-14 10:11:44 -070024 # git-cl wants us to be on a branch.
25 branch = 'tmp_%s' % api.uuid.random()
26 api.step('create git branch',
27 cmd=['git', 'checkout', '-b', branch],
borenet93408df2016-10-05 06:00:26 -070028 cwd=api.vars.skia_dir)
borenetcd72afa2016-10-14 10:11:44 -070029 try:
30 api.step('git status',
31 cmd=['git', 'status'],
32 cwd=api.vars.skia_dir)
borenet3493e172016-10-05 07:29:06 -070033
borenetcd72afa2016-10-14 10:11:44 -070034 depot_tools_path = api.depot_tools.package_repo_resource()
35 env = {'PATH': api.path.pathsep.join([str(depot_tools_path), '%(PATH)s'])}
36 api.step('presubmit',
37 cmd=['git', 'cl', 'presubmit', '--force', '-v', '-v'],
38 cwd=api.vars.skia_dir,
39 env=env)
40 finally:
41 api.step('git reset',
42 cmd=['git', 'reset', '--hard', 'origin/master'],
43 cwd=api.vars.skia_dir)
44 api.step('checkout origin/master',
45 cmd=['git', 'checkout', 'origin/master'],
46 cwd=api.vars.skia_dir)
47 api.step('delete git branch',
48 cmd=['git', 'branch', '-D', branch],
49 cwd=api.vars.skia_dir)
50
borenet93408df2016-10-05 06:00:26 -070051
52
53def GenTests(api):
54 yield (
55 api.test('presubmit') +
56 api.properties(buildername='Housekeeper-PerCommit-Presubmit',
57 mastername='client.skia.fyi',
58 slavename='dummy-slave',
59 buildnumber=5,
Eric Borenad29aee2017-01-17 14:35:06 -050060 repository='https://skia.googlesource.com/skia.git',
borenet93408df2016-10-05 06:00:26 -070061 revision='abc123',
62 path_config='kitchen',
63 swarm_out_dir='[SWARM_OUT_DIR]')
64 )