Skip to content

Commit 7de0314

Browse files
ahornbyfacebook-github-bot
authored andcommitted
cachelib: regenerate github actions
Summary: X-link: facebook/CacheLib#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
1 parent 5ce3325 commit 7de0314

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

build/fbcode_builder/getdeps.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,10 @@ def get_run_on(self, args):
10071007
if args.run_on_all_branches:
10081008
return self.RUN_ON_ALL
10091009
if args.cron:
1010-
return f"""
1010+
if args.cron == "never":
1011+
return " {}"
1012+
else:
1013+
return f"""
10111014
schedule:
10121015
- cron: '{args.cron}'"""
10131016

@@ -1062,18 +1065,27 @@ def write_job_for_platform(self, platform, args): # noqa: C901
10621065

10631066
if build_opts.is_linux():
10641067
artifacts = "linux"
1065-
runs_on = f"ubuntu-{args.ubuntu_version}"
1066-
if args.cpu_cores:
1067-
runs_on = f"{args.cpu_cores}-core-ubuntu-{args.ubuntu_version}"
1068+
if args.runs_on:
1069+
runs_on = args.runs_on
1070+
else:
1071+
runs_on = f"ubuntu-{args.ubuntu_version}"
1072+
if args.cpu_cores:
1073+
runs_on = f"{args.cpu_cores}-core-ubuntu-{args.ubuntu_version}"
10681074
elif build_opts.is_windows():
10691075
artifacts = "windows"
1070-
runs_on = "windows-2019"
1076+
if args.runs_on:
1077+
runs_on = args.runs_on
1078+
else:
1079+
runs_on = "windows-2019"
10711080
# The windows runners are python 3 by default; python2.exe
10721081
# is available if needed.
10731082
py3 = "python"
10741083
else:
10751084
artifacts = "mac"
1076-
runs_on = "macOS-latest"
1085+
if args.runs_on:
1086+
runs_on = args.runs_on
1087+
else:
1088+
runs_on = "macOS-latest"
10771089

10781090
os.makedirs(args.output_dir, exist_ok=True)
10791091

@@ -1366,9 +1378,13 @@ def setup_project_cmd_parser(self, parser):
13661378
"--cpu-cores",
13671379
help="Number of CPU cores to use (applicable for Linux OS)",
13681380
)
1381+
parser.add_argument(
1382+
"--runs-on",
1383+
help="Allow specifying explicit runs-on: for github actions",
1384+
)
13691385
parser.add_argument(
13701386
"--cron",
1371-
help="Specify that the job runs on a cron schedule instead of on pushes",
1387+
help="Specify that the job runs on a cron schedule instead of on pushes. Pass never to disable the action.",
13721388
)
13731389
parser.add_argument(
13741390
"--main-branch",

0 commit comments

Comments
 (0)