Skip to content

Commit

Permalink
chore(ci): disable on draft pull requests
Browse files Browse the repository at this point in the history
As draft PRs are explicitly in a state which is not ready to be merged,
there is no need to run the full suite of CI workflows every time there
is an update. In particular, this commit disables:

- Cirrus workflows, as Cirrus has a minute quota
- Wheel builds
- Long-running tests

The test matrix is _still_ being run.

Signed-off-by: JP-Ellis <[email protected]>
  • Loading branch information
JP-Ellis committed Oct 8, 2023
1 parent fbd1fbe commit f943b46
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
TEST_TEMPLATE: &TEST_TEMPLATE
skip: $CIRRUS_PR_DRAFT == "true"
arch_check_script:
- uname -am
test_script:
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ env:
jobs:
build-x86_64:
name: Build wheels on ${{ matrix.os }} (x86, 64-bit)

if: github.event_name == 'push' || ! github.event.pull_request.draft
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -58,6 +60,8 @@ jobs:

build-x86:
name: Build wheels on ${{ matrix.os }} (x86, 32-bit)

if: github.event_name == 'push' || ! github.event.pull_request.draft
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -86,11 +90,12 @@ jobs:

build-arm64:
name: Build wheels on ${{ matrix.os }} (arm64)
runs-on: ${{ matrix.os }}

# As this requires emulation, it's not worth running on PRs
if: >-
github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags')
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -129,11 +134,13 @@ jobs:

check:
name: Check wheels

runs-on: ubuntu-latest

needs:
- build-x86_64
- build-x86
- build-arm64
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -152,11 +159,13 @@ jobs:
publish:
name: Publish wheels

if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
needs: [check]
runs-on: ubuntu-latest
environment: Upload Python Package

needs: [check]

steps:
- uses: actions/download-artifact@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
name: Example

runs-on: ubuntu-latest
if: github.event_name == 'push' || ! github.event.pull_request.draft

services:
broker:
image: pactfoundation/pact-broker:latest
Expand Down

0 comments on commit f943b46

Please sign in to comment.