| # 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 recipe_engine.post_process import StatusSuccess |
| from recipe_engine.recipe_api import Property |
| |
| PYTHON_VERSION_COMPATIBILITY = "PY3" |
| |
| DEPS = [ |
| "fuchsia/checkout", |
| "fuchsia/goma", |
| "fuchsia/status_check", |
| "recipe_engine/buildbucket", |
| "recipe_engine/context", |
| "recipe_engine/properties", |
| "recipe_engine/step", |
| ] |
| |
| PROPERTIES = { |
| "manifest": Property(kind=str, help="Jiri manifest to use"), |
| "remote": Property(kind=str, help="Remote manifest repository"), |
| } |
| |
| |
| def RunSteps(api, manifest, remote): |
| api.goma.ensure() |
| with api.context(infra_steps=True): |
| checkout = api.checkout.fuchsia_with_options( |
| manifest=manifest, |
| remote=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): |
| yield ( |
| api.status_check.test("ci") |
| + api.properties( |
| manifest="cobalt", remote="https://fuchsia.googlesource.com/manifest" |
| ) |
| + api.post_process(StatusSuccess) |
| ) |
| |
| yield ( |
| api.status_check.test("cq_try") |
| + api.buildbucket.try_build(git_repo="https://fuchsia.googlesource.com/cobalt") |
| + api.properties( |
| manifest="cobalt", |
| remote="https://fuchsia.googlesource.com/manifest", |
| ) |
| + api.post_process(StatusSuccess) |
| ) |