| # 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 |
| |
| DEPS = [ |
| "fuchsia/buildbucket_util", |
| "fuchsia/checkout", |
| "fuchsia/goma", |
| "recipe_engine/context", |
| "recipe_engine/properties", |
| "recipe_engine/step", |
| ] |
| |
| PROPERTIES = InputProperties |
| |
| |
| def RunSteps(api, props): |
| checkout = api.checkout.fuchsia_with_options( |
| manifest=props.manifest, |
| remote=props.remote, |
| ) |
| |
| # Start the cobalt build process. |
| with api.context(cwd=checkout.root_dir / "cobalt"): |
| api.step("setup", ["./cobaltb.py", "setup"]) |
| with api.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() |