From 1407aac779e5e51b9d898509cc357cd07e9b4f57 Mon Sep 17 00:00:00 2001 From: salman Date: Thu, 24 Jul 2025 09:11:46 +0100 Subject: [PATCH] Skip CI for draft PRs (#2970) --- .github/workflows/base.yml | 4 ++-- .github/workflows/lint.yml | 2 ++ .github/workflows/multi-gpu-e2e.yml | 2 +- .github/workflows/preview-docs.yml | 3 ++- .github/workflows/tests.yml | 9 +++++++-- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 2ffe85fe4..e97e73442 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -17,7 +17,7 @@ on: jobs: build-base: - if: github.repository_owner == 'axolotl-ai-cloud' + if: ${{ github.repository_owner == 'axolotl-ai-cloud' && (github.event_name != 'pull_request' || !github.event.pull_request.draft) }} timeout-minutes: 480 # this job needs to be run on self-hosted GPU runners... runs-on: ubuntu-latest-m @@ -108,7 +108,7 @@ jobs: PYTORCH_VERSION=${{ matrix.pytorch }} TORCH_CUDA_ARCH_LIST=${{ matrix.torch_cuda_arch_list }} build-base-uv: - if: github.repository_owner == 'axolotl-ai-cloud' + if: ${{ github.repository_owner == 'axolotl-ai-cloud' && (github.event_name != 'pull_request' || !github.event.pull_request.draft) }} timeout-minutes: 480 runs-on: ubuntu-latest-m strategy: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d04450428..cf322f105 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,6 +3,7 @@ on: # check on PRs, and manual triggers merge_group: pull_request: + types: [opened, synchronize, reopened, ready_for_review] paths: - '**.py' - 'requirements.txt' @@ -16,6 +17,7 @@ jobs: pre-commit: name: pre-commit runs-on: ubuntu-latest + if: ${{ !github.event.pull_request.draft }} steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 diff --git a/.github/workflows/multi-gpu-e2e.yml b/.github/workflows/multi-gpu-e2e.yml index f58c05f3b..f26201ef0 100644 --- a/.github/workflows/multi-gpu-e2e.yml +++ b/.github/workflows/multi-gpu-e2e.yml @@ -21,7 +21,7 @@ concurrency: jobs: test-axolotl-multigpu: - if: ${{ ! contains(github.event.commits[0].message, '[skip e2e]') && github.repository_owner == 'axolotl-ai-cloud' }} + if: ${{ ! contains(github.event.commits[0].message, '[skip e2e]') && github.repository_owner == 'axolotl-ai-cloud' && (github.event_name != 'pull_request' || !github.event.pull_request.draft) }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index a13d2c97f..162665ed5 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -2,7 +2,7 @@ name: Preview on: workflow_dispatch: pull_request: - types: [opened, synchronize, reopened] + types: [opened, synchronize, reopened, ready_for_review] # Run the workflow only when one of these files changes paths: @@ -25,6 +25,7 @@ permissions: jobs: preview: runs-on: ubuntu-latest + if: ${{ !github.event.pull_request.draft }} steps: - name: Check out repository uses: actions/checkout@v4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d4818f280..e0c8faba6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,6 +13,7 @@ on: - 'cicd/cicd.sh' - 'cicd/Dockerfile.jinja' pull_request: + types: [opened, synchronize, reopened, ready_for_review] paths: - '**.py' - 'requirements.txt' @@ -34,6 +35,7 @@ jobs: pre-commit: name: pre-commit runs-on: ubuntu-latest + if: ${{ !github.event.pull_request.draft }} steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -47,6 +49,7 @@ jobs: pytest: name: PyTest runs-on: ubuntu-latest + if: ${{ !github.event.pull_request.draft }} # needs: [preload-cache] strategy: fail-fast: false @@ -121,6 +124,7 @@ jobs: pytest-sdist: name: PyTest from Source Dist runs-on: ubuntu-latest + if: ${{ !github.event.pull_request.draft }} strategy: fail-fast: false matrix: @@ -185,7 +189,7 @@ jobs: docker-e2e-tests-1st: # Run this job first as a gate for running the remainder of the test matrix - if: ${{ ! contains(github.event.commits[0].message, '[skip e2e]') && github.repository_owner == 'axolotl-ai-cloud' }} + if: ${{ ! contains(github.event.commits[0].message, '[skip e2e]') && github.repository_owner == 'axolotl-ai-cloud' && !github.event.pull_request.draft }} # this job needs to be run on self-hosted GPU runners... runs-on: [self-hosted, modal] timeout-minutes: 120 @@ -235,7 +239,7 @@ jobs: modal run cicd.e2e_tests docker-e2e-tests: - if: github.repository_owner == 'axolotl-ai-cloud' + if: ${{ github.repository_owner == 'axolotl-ai-cloud' && !github.event.pull_request.draft }} # this job needs to be run on self-hosted GPU runners... runs-on: [self-hosted, modal] timeout-minutes: 120 @@ -289,6 +293,7 @@ jobs: runs-on: [self-hosted, modal] timeout-minutes: 90 needs: [docker-e2e-tests] + if: ${{ !github.event.pull_request.draft }} strategy: fail-fast: false