Skip to content

Commit

Permalink
Disable CI for draft PRs (#1009)
Browse files Browse the repository at this point in the history
------------------------------------------------------------------------------------------------------------

**Context:**
Tooling Team has requested that all CI checks for draft PRs across all
PennyLane repos are to be disabled to free up resources. [SC
Story](https://app.shortcut.com/xanaduai/story/66346/disable-ci-for-pl-draft-prs).

**Description of the Change:**
Conditions for checking whether a PR is in draft state have been added
to existing workflows.

**Benefits:**
Reduces resource usage.

**Possible Drawbacks:**
Some development steps are deferred to PRs in "ready for review" state
only.

**Related GitHub Issues:**
N/A

### Verification:
Created this PR as draft, no GitHub runners were used by CI. The 2
successful checks are codecov and readthedocs which do not use these
resources. When marked as "ready for review" the CI checks ran
(excluding wheel build checks). When the `author:build-wheel` label was
added, the remaining tests ran.

![Screenshot from 2024-08-09
16-46-53](https://github.com/user-attachments/assets/e66e9ca8-83c8-4a9a-a547-b1fd03c96289)
  • Loading branch information
anthayes92 authored Aug 13, 2024
1 parent 5d14add commit f09c728
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-wheel-linux-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- reopened
- synchronize
- labeled
- ready_for_review
push:
branches: [ main ]
workflow_dispatch:
Expand All @@ -21,6 +22,7 @@ concurrency:

jobs:
check_if_wheel_build_required:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/check-for-wheel-build.yml

constants:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-wheel-linux-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- reopened
- synchronize
- labeled
- ready_for_review
push:
branches: [ main ]
workflow_dispatch:
Expand All @@ -18,12 +19,14 @@ concurrency:

jobs:
determine_runner:
if: github.event.pull_request.draft == false
name: Determine runner type to use
uses: ./.github/workflows/determine-workflow-runner.yml
with:
default_runner: ubuntu-latest

check_if_wheel_build_required:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/check-for-wheel-build.yml

constants:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-wheel-macos-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- reopened
- synchronize
- labeled
- ready_for_review
push:
branches: [ main ]
workflow_dispatch:
Expand All @@ -21,6 +22,7 @@ concurrency:

jobs:
check_if_wheel_build_required:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/check-for-wheel-build.yml

constants:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-wheel-macos-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- reopened
- synchronize
- labeled
- ready_for_review
push:
branches: [ main ]
workflow_dispatch:
Expand All @@ -21,6 +22,7 @@ concurrency:

jobs:
check_if_wheel_build_required:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/check-for-wheel-build.yml

constants:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/check-catalyst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Check Catalyst Build

on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
branches: [ main ]
workflow_dispatch:
Expand All @@ -12,6 +17,7 @@ concurrency:

jobs:
determine_runner:
if: github.event.pull_request.draft == false
name: Determine runner type to use
uses: ./.github/workflows/determine-workflow-runner.yml
with:
Expand Down

0 comments on commit f09c728

Please sign in to comment.