From 5ee08ec2ed8e1f9e51b3b38b862b3a69c4b4e3a2 Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Sun, 5 Feb 2023 13:22:50 -0600 Subject: [PATCH] Use public runners on forked repos (#1052) Resolves actions stalling endlessly on forks with: image See: https://github.com/GleasonK/stablehlo/actions/runs/4087406604 - clang-format has the change and uses the public runner - lint whitespace does not and waits for runner Forked repo running CI: https://github.com/GleasonK/stablehlo/actions?query=ci-runner OpenXLA repo running CI: https://github.com/openxla/stablehlo/actions?query=ci-runner --- .github/workflows/buildAndTestCMake.yml | 2 +- .github/workflows/buildBazel.yml | 2 +- .github/workflows/lint.yml | 5 +++-- .github/workflows/markdown_lint.yml | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/buildAndTestCMake.yml b/.github/workflows/buildAndTestCMake.yml index 1c75d7012f0..a53191188d2 100644 --- a/.github/workflows/buildAndTestCMake.yml +++ b/.github/workflows/buildAndTestCMake.yml @@ -43,7 +43,7 @@ jobs: STABLEHLO_PYTHON_BUILD_DIR: "stablehlo-python-build" strategy: fail-fast: false - runs-on: ubuntu-22.04-64core + runs-on: ${{ github.repository == 'openxla/stablehlo' && 'ubuntu-22.04-64core' || 'ubuntu-22.04' }} steps: - name: Checkout StableHLO diff --git a/.github/workflows/buildBazel.yml b/.github/workflows/buildBazel.yml index 2a168f637b9..f73710cab2b 100644 --- a/.github/workflows/buildBazel.yml +++ b/.github/workflows/buildBazel.yml @@ -38,7 +38,7 @@ jobs: bazel-build: strategy: fail-fast: false - runs-on: ubuntu-22.04-64core + runs-on: ${{ github.repository == 'openxla/stablehlo' && 'ubuntu-22.04-64core' || 'ubuntu-22.04' }} steps: - name: Checkout StableHLO diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b3768f4dfb8..29f529211ee 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,8 +21,9 @@ on: jobs: clang-format: # This job can only be run on pull_request since GITHUB_BASE_REF is only set on PR. + # In forks, run this on public GH runners. 64core infra will ignore jobs from forks. if: "github.event_name == 'pull_request'" - runs-on: ubuntu-22.04-64core + runs-on: ${{ github.repository == 'openxla/stablehlo' && 'ubuntu-22.04-64core' || 'ubuntu-22.04' }} steps: - name: Checking out repository uses: actions/checkout@v2 @@ -35,7 +36,7 @@ jobs: whitespace-checks: # This job can only be run on pull_request since GITHUB_BASE_REF is only set on PR. if: "github.event_name == 'pull_request'" - runs-on: ubuntu-22.04-64core + runs-on: ${{ github.repository == 'openxla/stablehlo' && 'ubuntu-22.04-64core' || 'ubuntu-22.04' }} steps: - name: Checking out repository uses: actions/checkout@v2 diff --git a/.github/workflows/markdown_lint.yml b/.github/workflows/markdown_lint.yml index a5308e54056..b9a2e169326 100644 --- a/.github/workflows/markdown_lint.yml +++ b/.github/workflows/markdown_lint.yml @@ -22,7 +22,7 @@ on: jobs: markdown-lint: - runs-on: ubuntu-22.04-64core + runs-on: ${{ github.repository == 'openxla/stablehlo' && 'ubuntu-22.04-64core' || 'ubuntu-22.04' }} steps: - name: Checking out repository uses: actions/checkout@v3