1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-07 07:02:53 +03:00

cachelib: regenerate github actions

Summary:
X-link: https://github.com/facebook/CacheLib/pull/388

Regenerate github actions.  Adds --runs-on arg to pass runs-on: parameter cachelib needs

Reviewed By: pbhandar2

Differential Revision: D75015742

fbshipit-source-id: af5803fa95fd4c2b9f25a7eaa817ffe2d135d23c
This commit is contained in:
Alex Hornby
2025-05-19 17:05:48 -07:00
committed by Facebook GitHub Bot
parent 5ce332564a
commit 7de0314b74

View File

@@ -1007,6 +1007,9 @@ class GenerateGitHubActionsCmd(ProjectCmdBase):
if args.run_on_all_branches:
return self.RUN_ON_ALL
if args.cron:
if args.cron == "never":
return " {}"
else:
return f"""
schedule:
- cron: '{args.cron}'"""
@@ -1062,17 +1065,26 @@ class GenerateGitHubActionsCmd(ProjectCmdBase):
if build_opts.is_linux():
artifacts = "linux"
if args.runs_on:
runs_on = args.runs_on
else:
runs_on = f"ubuntu-{args.ubuntu_version}"
if args.cpu_cores:
runs_on = f"{args.cpu_cores}-core-ubuntu-{args.ubuntu_version}"
elif build_opts.is_windows():
artifacts = "windows"
if args.runs_on:
runs_on = args.runs_on
else:
runs_on = "windows-2019"
# The windows runners are python 3 by default; python2.exe
# is available if needed.
py3 = "python"
else:
artifacts = "mac"
if args.runs_on:
runs_on = args.runs_on
else:
runs_on = "macOS-latest"
os.makedirs(args.output_dir, exist_ok=True)
@@ -1366,9 +1378,13 @@ jobs:
"--cpu-cores",
help="Number of CPU cores to use (applicable for Linux OS)",
)
parser.add_argument(
"--runs-on",
help="Allow specifying explicit runs-on: for github actions",
)
parser.add_argument(
"--cron",
help="Specify that the job runs on a cron schedule instead of on pushes",
help="Specify that the job runs on a cron schedule instead of on pushes. Pass never to disable the action.",
)
parser.add_argument(
"--main-branch",