blob: 32cb787a1fad7489ca5a8f4c5fbd8e1bc66904a1 [file] [log] [blame]
# Copyright 2016 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Recipe for building and testing Cobalt."""
from PB.recipes.fuchsia.cobalt import InputProperties
PYTHON_VERSION_COMPATIBILITY = "PY3"
DEPS = [
"fuchsia/buildbucket_util",
"fuchsia/checkout",
"fuchsia/goma",
"recipe_engine/context",
"recipe_engine/properties",
"recipe_engine/step",
]
PROPERTIES = InputProperties
def RunSteps(api, props):
api.goma.ensure()
checkout = api.checkout.fuchsia_with_options(
manifest=props.manifest,
remote=props.remote,
)
# Start the cobalt build process.
with api.context(cwd=checkout.root_dir.join("cobalt")):
api.step("setup", ["./cobaltb.py", "setup"])
with api.goma.build_with_goma():
api.step(
"build", ["./cobaltb.py", "build", "--goma_dir", api.goma.goma_dir]
)
api.step("lint", ["./cobaltb.py", "lint", "--all"])
api.step("test", ["./cobaltb.py", "test"])
def GenTests(api):
def properties():
return api.properties(
manifest="cobalt", remote="https://fuchsia.googlesource.com/manifest"
)
yield api.buildbucket_util.test("ci") + properties()
yield api.buildbucket_util.test("cq_try", tryjob=True) + properties()