Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't run CI in forks #12267

Merged
merged 3 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

jobs:
audit:
if: ${{ github.repository_owner == 'pantsbuild' }}
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cancel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

jobs:
cancel:
if: ${{ github.repository_owner == 'pantsbuild' }}
runs-on: ubuntu-latest
steps:
- uses: styfle/cancel-workflow-action@0.8.0
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
env:
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ${{ github.repository_owner == 'pantsbuild' }}
name: Bootstrap Pants, test+lint Rust (Linux)
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -155,6 +156,7 @@ jobs:
env:
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ${{ github.repository_owner == 'pantsbuild' }}
name: Bootstrap Pants, test Rust (macOS)
runs-on: macos-10.15
steps:
Expand Down Expand Up @@ -274,6 +276,7 @@ jobs:
- '3.9'
timeout-minutes: 40
lint_python:
if: ${{ github.repository_owner == 'pantsbuild' }}
name: Lint Python and Shell
needs: bootstrap_pants_linux
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -350,6 +353,7 @@ jobs:
- '3.9'
timeout-minutes: 30
test_python_linux:
if: ${{ github.repository_owner == 'pantsbuild' }}
name: Test Python (Linux)
needs: bootstrap_pants_linux
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -428,6 +432,7 @@ jobs:
test_python_macos:
env:
ARCHFLAGS: -arch x86_64
if: ${{ github.repository_owner == 'pantsbuild' }}
name: Test Python (macOS)
needs: bootstrap_pants_macos
runs-on: macos-10.15
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
env:
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ${{ github.repository_owner == 'pantsbuild' }}
name: Bootstrap Pants, test+lint Rust (Linux)
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -154,6 +155,7 @@ jobs:
env:
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ${{ github.repository_owner == 'pantsbuild' }}
name: Bootstrap Pants, test Rust (macOS)
runs-on: macos-10.15
steps:
Expand Down Expand Up @@ -276,6 +278,7 @@ jobs:
env:
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ${{ github.repository_owner == 'pantsbuild' }}
name: Build wheels and fs_util (Linux)
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -348,6 +351,7 @@ jobs:
env:
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ${{ github.repository_owner == 'pantsbuild' }}
name: Build wheels and fs_util (macOS)
runs-on: macos-10.15
steps:
Expand Down Expand Up @@ -436,6 +440,7 @@ jobs:
run: ./build-support/bin/deploy_to_s3.py
timeout-minutes: 65
lint_python:
if: ${{ github.repository_owner == 'pantsbuild' }}
name: Lint Python and Shell
needs: bootstrap_pants_linux
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -511,6 +516,7 @@ jobs:
- '3.7'
timeout-minutes: 30
test_python_linux:
if: ${{ github.repository_owner == 'pantsbuild' }}
name: Test Python (Linux)
needs: bootstrap_pants_linux
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -588,6 +594,7 @@ jobs:
test_python_macos:
env:
ARCHFLAGS: -arch x86_64
if: ${{ github.repository_owner == 'pantsbuild' }}
name: Test Python (macOS)
needs: bootstrap_pants_macos
runs-on: macos-10.15
Expand Down
11 changes: 11 additions & 0 deletions build-support/bin/generate_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
MACOS_ENV = {"ARCHFLAGS": "-arch x86_64"}


IS_PANTS_OWNER = "${{ github.repository_owner == 'pantsbuild' }}"

# ----------------------------------------------------------------------
# Actions
# ----------------------------------------------------------------------
Expand Down Expand Up @@ -261,6 +263,7 @@ def test_workflow_jobs(python_versions: list[str], *, cron: bool) -> Jobs:
"strategy": {"matrix": {"python-version": python_versions}},
"env": DISABLE_REMOTE_CACHE_ENV,
"timeout-minutes": 40,
"if": IS_PANTS_OWNER,
"steps": [
*checkout(),
setup_toolchain_auth(),
Expand Down Expand Up @@ -302,6 +305,7 @@ def test_workflow_jobs(python_versions: list[str], *, cron: bool) -> Jobs:
"needs": "bootstrap_pants_linux",
"strategy": {"matrix": {"python-version": python_versions}},
"timeout-minutes": 60,
"if": IS_PANTS_OWNER,
"steps": [
*checkout(),
setup_toolchain_auth(),
Expand All @@ -319,6 +323,7 @@ def test_workflow_jobs(python_versions: list[str], *, cron: bool) -> Jobs:
"needs": "bootstrap_pants_linux",
"strategy": {"matrix": {"python-version": python_versions}},
"timeout-minutes": 30,
"if": IS_PANTS_OWNER,
"steps": [
*checkout(),
setup_toolchain_auth(),
Expand All @@ -338,6 +343,7 @@ def test_workflow_jobs(python_versions: list[str], *, cron: bool) -> Jobs:
"strategy": {"matrix": {"python-version": python_versions}},
"env": DISABLE_REMOTE_CACHE_ENV,
"timeout-minutes": 40,
"if": IS_PANTS_OWNER,
"steps": [
*checkout(),
setup_toolchain_auth(),
Expand All @@ -363,6 +369,7 @@ def test_workflow_jobs(python_versions: list[str], *, cron: bool) -> Jobs:
"strategy": {"matrix": {"python-version": python_versions}},
"env": MACOS_ENV,
"timeout-minutes": 40,
"if": IS_PANTS_OWNER,
"steps": [
*checkout(),
setup_toolchain_auth(),
Expand Down Expand Up @@ -418,6 +425,7 @@ def build_wheels_step(*, is_macos: bool) -> Step:
"container": "quay.io/pypa/manylinux2014_x86_64:latest",
"timeout-minutes": 65,
"env": DISABLE_REMOTE_CACHE_ENV,
"if": IS_PANTS_OWNER,
"steps": [
*checkout(),
install_rustup(),
Expand All @@ -441,6 +449,7 @@ def build_wheels_step(*, is_macos: bool) -> Step:
"runs-on": MACOS_VERSION,
"timeout-minutes": 65,
"env": DISABLE_REMOTE_CACHE_ENV,
"if": IS_PANTS_OWNER,
"steps": [
*checkout(),
setup_toolchain_auth(),
Expand Down Expand Up @@ -522,6 +531,7 @@ def generate() -> dict[Path, str]:
"jobs": {
"cancel": {
"runs-on": "ubuntu-latest",
"if": IS_PANTS_OWNER,
"steps": [
{
"uses": "styfle/cancel-workflow-action@0.8.0",
Expand All @@ -544,6 +554,7 @@ def generate() -> dict[Path, str]:
"jobs": {
"audit": {
"runs-on": "ubuntu-latest",
"if": IS_PANTS_OWNER,
"steps": [
*checkout(),
{
Expand Down