mirror of
https://github.com/facebook/proxygen.git
synced 2025-08-07 07:02:53 +03:00
generate the eden_scm github actions (#103)
Summary: Pull Request resolved: https://github.com/facebookexperimental/eden/pull/103 Automate maintenance of the edenscm_* github actions yamls Add job file and name options and support for the Rust install section Reviewed By: fanzeyi Differential Revision: D34044422 fbshipit-source-id: 7d5f07d37bab1eff5de30a88e710dbf7479ca192
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e6c0e7ddc9
commit
dd4790b3f9
@@ -900,24 +900,35 @@ class GenerateGitHubActionsCmd(ProjectCmdBase):
|
|||||||
py3 = "python3"
|
py3 = "python3"
|
||||||
|
|
||||||
if build_opts.is_linux():
|
if build_opts.is_linux():
|
||||||
job_name = "linux"
|
artifacts = "linux"
|
||||||
runs_on = f"ubuntu-{args.ubuntu_version}"
|
runs_on = f"ubuntu-{args.ubuntu_version}"
|
||||||
elif build_opts.is_windows():
|
elif build_opts.is_windows():
|
||||||
# We're targeting the windows-2016 image because it has
|
# We're targeting the windows-2016 image because it has
|
||||||
# Visual Studio 2017 installed, and at the time of writing,
|
# Visual Studio 2017 installed, and at the time of writing,
|
||||||
# the version of boost in the manifests (1.69) is not
|
# the version of boost in the manifests (1.69) is not
|
||||||
# buildable with Visual Studio 2019
|
# buildable with Visual Studio 2019
|
||||||
job_name = "windows"
|
artifacts = "windows"
|
||||||
runs_on = "windows-2016"
|
runs_on = "windows-2016"
|
||||||
# The windows runners are python 3 by default; python2.exe
|
# The windows runners are python 3 by default; python2.exe
|
||||||
# is available if needed.
|
# is available if needed.
|
||||||
py3 = "python"
|
py3 = "python"
|
||||||
else:
|
else:
|
||||||
job_name = "mac"
|
artifacts = "mac"
|
||||||
runs_on = "macOS-latest"
|
runs_on = "macOS-latest"
|
||||||
|
|
||||||
os.makedirs(args.output_dir, exist_ok=True)
|
os.makedirs(args.output_dir, exist_ok=True)
|
||||||
output_file = os.path.join(args.output_dir, f"getdeps_{job_name}.yml")
|
|
||||||
|
job_file_prefix = "getdeps_"
|
||||||
|
if args.job_file_prefix:
|
||||||
|
job_file_prefix = args.job_file_prefix
|
||||||
|
|
||||||
|
output_file = os.path.join(args.output_dir, f"{job_file_prefix}{artifacts}.yml")
|
||||||
|
|
||||||
|
if args.job_name_prefix:
|
||||||
|
job_name = args.job_name_prefix + artifacts.capitalize()
|
||||||
|
else:
|
||||||
|
job_name = artifacts
|
||||||
|
|
||||||
with open(output_file, "w") as out:
|
with open(output_file, "w") as out:
|
||||||
# Deliberate line break here because the @ and the generated
|
# Deliberate line break here because the @ and the generated
|
||||||
# symbols are meaningful to our internal tooling when they
|
# symbols are meaningful to our internal tooling when they
|
||||||
@@ -963,15 +974,42 @@ jobs:
|
|||||||
|
|
||||||
projects = loader.manifests_in_dependency_order()
|
projects = loader.manifests_in_dependency_order()
|
||||||
|
|
||||||
for m in projects:
|
allow_sys_arg = ""
|
||||||
if m != manifest:
|
if (
|
||||||
out.write(" - name: Fetch %s\n" % m.name)
|
build_opts.allow_system_packages
|
||||||
out.write(f" run: {getdepscmd} fetch --no-tests {m.name}\n")
|
and build_opts.is_linux()
|
||||||
|
and build_opts.host_type.get_package_manager()
|
||||||
|
):
|
||||||
|
allow_sys_arg = " --allow-system-packages"
|
||||||
|
out.write(" - name: Install system deps\n")
|
||||||
|
out.write(
|
||||||
|
f" run: sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive {manifest.name}\n"
|
||||||
|
)
|
||||||
|
|
||||||
for m in projects:
|
for m in projects:
|
||||||
if m != manifest:
|
if m != manifest:
|
||||||
out.write(" - name: Build %s\n" % m.name)
|
if m.name == "rust":
|
||||||
out.write(f" run: {getdepscmd} build --no-tests {m.name}\n")
|
out.write(" - name: Install Rust Stable\n")
|
||||||
|
out.write(" uses: actions-rs/toolchain@v1\n")
|
||||||
|
out.write(" with:\n")
|
||||||
|
out.write(" toolchain: stable\n")
|
||||||
|
out.write(" default: true\n")
|
||||||
|
out.write(" profile: minimal\n")
|
||||||
|
else:
|
||||||
|
out.write(" - name: Fetch %s\n" % m.name)
|
||||||
|
out.write(
|
||||||
|
f" run: {getdepscmd}{allow_sys_arg} fetch --no-tests {m.name}\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
for m in projects:
|
||||||
|
if m != manifest:
|
||||||
|
if m.name == "rust":
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
out.write(" - name: Build %s\n" % m.name)
|
||||||
|
out.write(
|
||||||
|
f" run: {getdepscmd}{allow_sys_arg} build --no-tests {m.name}\n"
|
||||||
|
)
|
||||||
|
|
||||||
out.write(" - name: Build %s\n" % manifest.name)
|
out.write(" - name: Build %s\n" % manifest.name)
|
||||||
|
|
||||||
@@ -982,7 +1020,7 @@ jobs:
|
|||||||
)
|
)
|
||||||
|
|
||||||
out.write(
|
out.write(
|
||||||
f" run: {getdepscmd} build --src-dir=. {manifest.name} {project_prefix}\n"
|
f" run: {getdepscmd}{allow_sys_arg} build --src-dir=. {manifest.name} {project_prefix}\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
out.write(" - name: Copy artifacts\n")
|
out.write(" - name: Copy artifacts\n")
|
||||||
@@ -996,8 +1034,8 @@ jobs:
|
|||||||
strip = ""
|
strip = ""
|
||||||
|
|
||||||
out.write(
|
out.write(
|
||||||
f" run: {getdepscmd} fixup-dyn-deps{strip} "
|
f" run: {getdepscmd}{allow_sys_arg} fixup-dyn-deps{strip} "
|
||||||
f"--src-dir=. {manifest.name} _artifacts/{job_name} {project_prefix} "
|
f"--src-dir=. {manifest.name} _artifacts/{artifacts} {project_prefix} "
|
||||||
f"--final-install-prefix /usr/local\n"
|
f"--final-install-prefix /usr/local\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1008,7 +1046,7 @@ jobs:
|
|||||||
|
|
||||||
out.write(" - name: Test %s\n" % manifest.name)
|
out.write(" - name: Test %s\n" % manifest.name)
|
||||||
out.write(
|
out.write(
|
||||||
f" run: {getdepscmd} test --src-dir=. {manifest.name} {project_prefix}\n"
|
f" run: {getdepscmd}{allow_sys_arg} test --src-dir=. {manifest.name} {project_prefix}\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
def setup_project_cmd_parser(self, parser):
|
def setup_project_cmd_parser(self, parser):
|
||||||
@@ -1042,6 +1080,18 @@ jobs:
|
|||||||
dest="os_types",
|
dest="os_types",
|
||||||
default=[],
|
default=[],
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--job-file-prefix",
|
||||||
|
type=str,
|
||||||
|
help="add a prefix to all job file names",
|
||||||
|
default=None,
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--job-name-prefix",
|
||||||
|
type=str,
|
||||||
|
help="add a prefix to all job names",
|
||||||
|
default=None,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_arg_var_name(args):
|
def get_arg_var_name(args):
|
||||||
|
@@ -4,6 +4,10 @@ name = cmake
|
|||||||
[homebrew]
|
[homebrew]
|
||||||
cmake
|
cmake
|
||||||
|
|
||||||
|
# 18.04 cmake is too old
|
||||||
|
[debs.not(all(distro=ubuntu,distro_vers="18.04"))]
|
||||||
|
cmake
|
||||||
|
|
||||||
[rpms]
|
[rpms]
|
||||||
cmake
|
cmake
|
||||||
|
|
||||||
|
@@ -47,6 +47,8 @@ fbcode/fboss/common = common
|
|||||||
\.pyc$
|
\.pyc$
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
fb303
|
||||||
|
fbthrift
|
||||||
fb303-source
|
fb303-source
|
||||||
fbthrift-source
|
fbthrift-source
|
||||||
python
|
python
|
||||||
|
Reference in New Issue
Block a user