blob: cfa13ae21ff34c98882c62f3457432e87fbdd462 [file] [log] [blame]
borenet1ed2ae42016-07-26 11:52:17 -07001# 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
Eric Boren3be061c2018-03-12 08:59:00 -04008
9import calendar
10
11
borenet1ed2ae42016-07-26 11:52:17 -070012DEPS = [
Eric Boren90f05032018-05-24 09:14:18 -040013 'checkout',
14 'doxygen',
Eric Boren3be061c2018-03-12 08:59:00 -040015 'recipe_engine/file',
borenet1ed2ae42016-07-26 11:52:17 -070016 'recipe_engine/path',
17 'recipe_engine/properties',
Eric Boren7e97dc02017-02-02 09:02:37 -050018 'run',
19 'vars',
borenet1ed2ae42016-07-26 11:52:17 -070020]
21
22
borenet1ed2ae42016-07-26 11:52:17 -070023def RunSteps(api):
24 # Checkout, compile, etc.
Eric Borenb7023162018-05-04 13:46:15 -040025 api.vars.setup()
Eric Boren90f05032018-05-24 09:14:18 -040026 checkout_root = api.checkout.default_checkout_root
Kevin Lubick37baac12018-10-09 16:25:27 -040027 api.checkout.bot_update(checkout_root=checkout_root)
Eric Borenb7023162018-05-04 13:46:15 -040028 api.file.ensure_directory('makedirs tmp_dir', api.vars.tmp_dir)
borenet1ed2ae42016-07-26 11:52:17 -070029
borenet1ed2ae42016-07-26 11:52:17 -070030 # TODO(borenet): Detect static initializers?
31
Eric Boren90f05032018-05-24 09:14:18 -040032 skia_dir = checkout_root.join('skia')
33 if not api.vars.is_trybot:
34 api.doxygen.generate_and_upload(skia_dir)
Eric Boren53262d02017-03-20 15:40:12 -040035
jcgregorio106a9ff2016-08-12 08:50:29 -070036
borenet1ed2ae42016-07-26 11:52:17 -070037def GenTests(api):
Eric Boren22f5ef72016-12-02 11:01:33 -050038 yield (
39 api.test('Housekeeper-PerCommit') +
40 api.properties(buildername='Housekeeper-PerCommit',
Eric Borenad29aee2017-01-17 14:35:06 -050041 repository='https://skia.googlesource.com/skia.git',
Eric Boren22f5ef72016-12-02 11:01:33 -050042 revision='abc123',
43 path_config='kitchen',
44 swarm_out_dir='[SWARM_OUT_DIR]') +
45 api.path.exists(api.path['start_dir'])
46 )
47 yield (
48 api.test('Housekeeper-PerCommit-Trybot') +
49 api.properties(buildername='Housekeeper-PerCommit',
Eric Borenad29aee2017-01-17 14:35:06 -050050 repository='https://skia.googlesource.com/skia.git',
Eric Boren22f5ef72016-12-02 11:01:33 -050051 revision='abc123',
52 path_config='kitchen',
Kevin Lubick37baac12018-10-09 16:25:27 -040053 patch_issue='456789',
54 patch_set='11',
Eric Boren858f6482018-09-12 14:39:34 -040055 patch_ref='refs/changes/89/456789/12',
56 patch_repo='https://skia.googlesource.com/skia.git',
Eric Boren22f5ef72016-12-02 11:01:33 -050057 patch_storage='gerrit',
Eric Boren22f5ef72016-12-02 11:01:33 -050058 swarm_out_dir='[SWARM_OUT_DIR]') +
Eric Boren22f5ef72016-12-02 11:01:33 -050059 api.path.exists(api.path['start_dir'])
60 )