Skip to content

Commit

Permalink
check if owner is pytorch in jobs
Browse files Browse the repository at this point in the history
Fixes pytorch#72661

Adds check that pytorch is repo owner to jobs.  Ran `.github/regenerate.sh` to regenerate workflows.

Also removed `+` from various places to make jinja2 happy (doesn't seem to change anything about the generated workflows). Added them back in b/c I was using the wrong version of jinja2

Pull Request resolved: pytorch#74191
Approved by: https://github.com/seemethere, https://github.com/janeyx99
  • Loading branch information
clee2000 authored and pytorchmergebot committed Mar 15, 2022
1 parent 3b421af commit 7ab482f
Show file tree
Hide file tree
Showing 66 changed files with 186 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/templates/android_ci_full_workflow.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:
{% block build +%}
# building and testing in a single job since bazel runs only small subset of tests
build-and-test:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: !{{ test_runner_type }}
env:
JOB_BASE_NAME: !{{ build_environment }}-build-and-test
Expand Down
1 change: 1 addition & 0 deletions .github/templates/android_ci_workflow.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:
{% block build +%}
# building and testing in a single job since bazel runs only small subset of tests
build-and-test:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: !{{ test_runner_type }}
env:
JOB_BASE_NAME: !{{ build_environment }}-build-and-test
Expand Down
1 change: 1 addition & 0 deletions .github/templates/bazel_ci_workflow.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:
{% block build +%}
# building and testing in a single job since bazel runs only small subset of tests
build-and-test:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: !{{ test_runner_type }}
env:
JOB_BASE_NAME: !{{ build_environment }}-build-and-test
Expand Down
1 change: 1 addition & 0 deletions .github/templates/docker_builds_ci_workflow.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ env:
jobs:
{% block docker_build +%}
docker-build:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: linux.2xlarge
timeout-minutes: !{{ common.timeout_minutes }}
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/templates/ios_ci_workflow.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
build:
# NOTE: These builds will not run successfully without running on `pytorch/pytorch` due to the limitations
# of accessing secrets from forked pull requests and IOS' dependency on secrets for their build/test
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: macos-10.15
timeout-minutes: !{{ common.timeout_minutes }}
env:
Expand Down
3 changes: 3 additions & 0 deletions .github/templates/linux_ci_workflow.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ env:
jobs:
{% block build +%}
build:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: linux.2xlarge
timeout-minutes: !{{ common.timeout_minutes }}
env:
Expand Down Expand Up @@ -150,6 +151,7 @@ jobs:
{% block test +%}
{%- for test_job in test_jobs %}
!{{ test_job.id }}:
if: ${{ github.repository_owner == 'pytorch' }}
name: !{{ test_job.name }}
needs: build
runs-on: !{{ test_job.runner }}
Expand Down Expand Up @@ -323,6 +325,7 @@ jobs:
{%- endif -%}
{%- if enable_doc_jobs %}
build-docs:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: linux.2xlarge
timeout-minutes: !{{ common.timeout_minutes }}
strategy:
Expand Down
1 change: 1 addition & 0 deletions .github/templates/macos_binary_build_workflow.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ env:
jobs:
{%- for config in build_configs %}
!{{ config["build_name"] }}-build:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: macos-10.15
{%- if config["package_type"] == "libtorch" %}
# libtorch builds take a long time on github hosted runners
Expand Down
2 changes: 2 additions & 0 deletions .github/templates/macos_ci_workflow.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
jobs:
{% block build +%}
build:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: !{{ test_runner_type }}
env:
JOB_BASE_NAME: !{{ build_environment }}
Expand Down Expand Up @@ -67,6 +68,7 @@ jobs:
{% block test +%}
{%- for test_job in test_jobs %}
!{{ test_job.id }}:
if: ${{ github.repository_owner == 'pytorch' }}
name: !{{ test_job.name }}
needs: build
runs-on: !{{ test_job.runner }}
Expand Down
1 change: 1 addition & 0 deletions .github/templates/windows_binary_build_workflow.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ env:
jobs:
{%- for config in build_configs %}
!{{ config["build_name"] }}-build:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: windows.4xlarge
timeout-minutes: !{{ common.timeout_minutes }}
!{{ upload.binary_env(config, True) }}
Expand Down
2 changes: 2 additions & 0 deletions .github/templates/windows_ci_workflow.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ env:

jobs:
build:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: "windows.4xlarge"
timeout-minutes: !{{ common.timeout_minutes }}
env:
Expand Down Expand Up @@ -115,6 +116,7 @@ jobs:

{%- for test_job in test_jobs %}
!{{ test_job.id }}:
if: ${{ github.repository_owner == 'pytorch' }}
name: !{{ test_job.name }}
timeout-minutes: !{{ timeout_after + 30 }}
env:
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/generated-docker-builds.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/generated-ios-12-5-1-arm64-coreml.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/generated-ios-12-5-1-arm64-metal.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/generated-ios-12-5-1-arm64.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/generated-ios-12-5-1-x86-64-coreml.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/generated-ios-12-5-1-x86-64.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .github/workflows/generated-linux-bionic-py3.7-clang9.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .github/workflows/generated-linux-bionic-rocm4.5-py3.7.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .github/workflows/generated-linux-docs-push.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .github/workflows/generated-linux-docs.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7ab482f

Please sign in to comment.