| # Copyright 2022 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import json |
| |
| from PB.go.chromium.org.luci.buildbucket.proto import common as common_pb2 |
| |
| DEPS = [ |
| 'depot_tools/gitiles', |
| 'recipe_engine/buildbucket', |
| 'recipe_engine/platform', |
| ] |
| |
| PYTHON_VERSION_COMPATIBILITY = "PY3" |
| |
| DART_GERRIT = 'https://dart.googlesource.com/' |
| LINEARIZED_REPO = 'linear_sdk_flutter_engine' |
| LINEARIZED_REPO_URL = DART_GERRIT + LINEARIZED_REPO |
| COMMITS_JSON = 'commits.json' |
| ENGINE_REPO = 'mirrors/engine' |
| ENGINE_REPO_CHROMIUM_MIRROR = 'external/github.com/flutter/engine' |
| SDK_REPO = 'sdk' |
| |
| |
| def RunSteps(api): |
| commits = {} |
| if api.buildbucket.gitiles_commit.id: |
| commits = json.loads( |
| api.gitiles.download_file( |
| LINEARIZED_REPO_URL, |
| COMMITS_JSON, |
| api.buildbucket.gitiles_commit.id, |
| step_test_data=lambda: api.gitiles.test_api.make_encoded_file( |
| json.dumps({ |
| ENGINE_REPO_CHROMIUM_MIRROR: 'flutter_engine_hash', |
| SDK_REPO: 'dart_sdk_hash' |
| })))) |
| engine_rev = commits.get(ENGINE_REPO_CHROMIUM_MIRROR, 'HEAD') |
| sdk_rev = commits.get(SDK_REPO, 'HEAD') |
| |
| engine_commit = common_pb2.GitilesCommit( |
| host='flutter.googlesource.com', |
| project=ENGINE_REPO, |
| ref='refs/heads/main', |
| id=engine_rev) |
| |
| request = api.buildbucket.schedule_request( |
| project='flutter', |
| bucket='staging', |
| builder='Mac mac_ios_engine_profile', |
| gitiles_commit=engine_commit, |
| inherit_buildsets=False, |
| properties={ |
| 'gclient_custom_vars': { |
| 'dart_revision': sdk_rev, |
| 'download_dart_sdk': False |
| } |
| }) |
| build, = api.buildbucket.schedule([request]) |
| api.buildbucket.collect_builds([build.id], |
| raise_if_unsuccessful=True, |
| timeout=2 * 3600) |
| |
| |
| def GenTests(api): |
| yield api.test( |
| 'null', api.platform('linux', 64), |
| api.buildbucket.ci_build( |
| project='dart', |
| bucket='ci', |
| builder='flutter-ios', |
| git_repo='https://dart.googlesource.com/linear_sdk_flutter_engine.git', |
| )) |