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

Rebuild GitHub Actions workflows

Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/749

Updating generated workflow files to account for recent changes. Most notably, this updates the checkout action to v4 and sets an explicit read-only permission.

This also adds support for `--cron` in the codegen to account for only running CI on a schedule (useful for managing costs).

Reviewed By: ahornby

Differential Revision: D56165825

fbshipit-source-id: 298b16effefb6b8a2dc6cbcf07d4ec4a61f48364
This commit is contained in:
Paul O'Shannessy
2024-04-24 15:36:57 -07:00
committed by Facebook GitHub Bot
parent 5cea6ffcc1
commit 4efce72184
3 changed files with 17 additions and 2 deletions

View File

@@ -10,11 +10,14 @@ on:
branches: branches:
- main - main
permissions:
contents: read # to fetch code (actions/checkout)
jobs: jobs:
build: build:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- name: Fetch ninja - name: Fetch ninja
run: python3 build/fbcode_builder/getdeps.py fetch --no-tests ninja run: python3 build/fbcode_builder/getdeps.py fetch --no-tests ninja
- name: Fetch cmake - name: Fetch cmake

View File

@@ -10,11 +10,14 @@ on:
branches: branches:
- main - main
permissions:
contents: read # to fetch code (actions/checkout)
jobs: jobs:
build: build:
runs-on: macOS-latest runs-on: macOS-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- name: Fetch ninja - name: Fetch ninja
run: python3 build/fbcode_builder/getdeps.py fetch --no-tests ninja run: python3 build/fbcode_builder/getdeps.py fetch --no-tests ninja
- name: Fetch cmake - name: Fetch cmake

View File

@@ -944,6 +944,11 @@ class GenerateGitHubActionsCmd(ProjectCmdBase):
def get_run_on(self, args): def get_run_on(self, args):
if args.run_on_all_branches: if args.run_on_all_branches:
return self.RUN_ON_ALL return self.RUN_ON_ALL
if args.cron:
return f"""
schedule:
- cron: '{args.cron}'"""
return f""" return f"""
push: push:
branches: branches:
@@ -1213,6 +1218,10 @@ jobs:
parser.add_argument( parser.add_argument(
"--ubuntu-version", default="20.04", help="Version of Ubuntu to use" "--ubuntu-version", default="20.04", help="Version of Ubuntu to use"
) )
parser.add_argument(
"--cron",
help="Specify that the job runs on a cron schedule instead of on pushes",
)
parser.add_argument( parser.add_argument(
"--main-branch", "--main-branch",
default="main", default="main",