Run bazel build on mainline
This commit is contained in:
parent
307a6e71ee
commit
3329564f50
2 changed files with 13 additions and 11 deletions
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from steps import generic_linux, generic_windows, from_shell_output, extend_steps_env
|
from steps import generic_linux, generic_windows, from_shell_output, extend_steps_env, bazel
|
||||||
from sync_fork import sync_fork
|
from sync_fork import sync_fork
|
||||||
import git
|
import git
|
||||||
import yaml
|
import yaml
|
||||||
|
@ -50,7 +50,7 @@ if __name__ == '__main__':
|
||||||
# two placess).
|
# two placess).
|
||||||
steps.extend(generic_windows(
|
steps.extend(generic_windows(
|
||||||
os.getenv('ph_projects', 'llvm;clang;clang-tools-extra;libc;libcxx;libcxxabi;lld;libunwind;mlir;polly;flang')))
|
os.getenv('ph_projects', 'llvm;clang;clang-tools-extra;libc;libcxx;libcxxabi;lld;libunwind;mlir;polly;flang')))
|
||||||
|
steps.extend(bazel([], force=True))
|
||||||
if os.getenv('ph_skip_generated') is None:
|
if os.getenv('ph_skip_generated') is None:
|
||||||
e = os.environ.copy()
|
e = os.environ.copy()
|
||||||
# BUILDKITE_COMMIT might be an alias, e.g. "HEAD". Resolve it to make the build hermetic.
|
# BUILDKITE_COMMIT might be an alias, e.g. "HEAD". Resolve it to make the build hermetic.
|
||||||
|
|
|
@ -75,11 +75,12 @@ def generic_linux(projects: str, check_diff: bool) -> List:
|
||||||
return [linux_buld_step]
|
return [linux_buld_step]
|
||||||
|
|
||||||
|
|
||||||
def bazel(modified_files: Set[str]) -> List:
|
def bazel(modified_files: Set[str], force: bool = False) -> List:
|
||||||
if os.getenv('ph_skip_bazel') is not None:
|
if os.getenv('ph_skip_bazel') is not None:
|
||||||
logging.info('bazel build is skipped as "ph_skip_bazel" is set')
|
logging.info('bazel build is skipped as "ph_skip_bazel" is set')
|
||||||
return []
|
return []
|
||||||
updated_build = any(s.startswith('utils/bazel/') for s in modified_files)
|
updated_build = any(s.startswith('utils/bazel/') for s in modified_files)
|
||||||
|
if not force:
|
||||||
if updated_build:
|
if updated_build:
|
||||||
logging.info('files in utils/bazel/ modified, will trigger bazel build')
|
logging.info('files in utils/bazel/ modified, will trigger bazel build')
|
||||||
else:
|
else:
|
||||||
|
@ -92,6 +93,7 @@ def bazel(modified_files: Set[str]) -> List:
|
||||||
t = os.getenv('ph_bazel_agents')
|
t = os.getenv('ph_bazel_agents')
|
||||||
if t is not None:
|
if t is not None:
|
||||||
agents = json.loads(t)
|
agents = json.loads(t)
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
'label': ':bazel: bazel',
|
'label': ':bazel: bazel',
|
||||||
'key': 'bazel',
|
'key': 'bazel',
|
||||||
|
|
Loading…
Reference in a new issue