Skip to content

Commit 332a57d

Browse files
authored
Merge pull request #2221 from apradhana/ci/skip-drafts-pr
Skip build CI if a PR is a draft.
2 parents 50e1563 + ff3709c commit 332a57d

2 files changed

Lines changed: 33 additions & 21 deletions

File tree

.github/workflows/build.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ on:
1919
- 'pendingchanges/**'
2020
- '**.md'
2121
pull_request:
22+
# Add 'ready_for_review' to run CI when a draft PR is marked ready.
23+
types: [opened, synchronize, reopened, ready_for_review]
2224
branches:
2325
- '**'
2426
paths-ignore:
@@ -53,9 +55,10 @@ jobs:
5355
# VFX platform jobs. These are run on the appropriate CentOS images from
5456
# the provided ASWF docker containers
5557
if: |
56-
github.event_name != 'workflow_dispatch' ||
57-
github.event.inputs.type == 'all' ||
58-
github.event.inputs.type == 'linux'
58+
(github.event_name == 'push' ||
59+
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
60+
(github.event_name == 'workflow_dispatch' &&
61+
(github.event.inputs.type == 'all' || github.event.inputs.type == 'linux')))
5962
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
6063
name: >
6164
linux:${{ matrix.config.image }}-abi:${{ matrix.config.abi }}-cxx:${{ matrix.config.cxx }}-type:${{ matrix.config.build }}
@@ -119,9 +122,10 @@ jobs:
119122
windows:
120123
# Windows CI. Tests a dynamic build with MD.
121124
if: |
122-
github.event_name != 'workflow_dispatch' ||
123-
github.event.inputs.type == 'all' ||
124-
github.event.inputs.type == 'win'
125+
(github.event_name == 'push' ||
126+
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
127+
(github.event_name == 'workflow_dispatch' &&
128+
(github.event.inputs.type == 'all' || github.event.inputs.type == 'win')))
125129
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'windows-2022-8c-32g-300h') || 'windows-latest' }}
126130
name: windows
127131
env:
@@ -163,9 +167,10 @@ jobs:
163167

164168
macos:
165169
if: |
166-
github.event_name != 'workflow_dispatch' ||
167-
github.event.inputs.type == 'all' ||
168-
github.event.inputs.type == 'mac'
170+
(github.event_name == 'push' ||
171+
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
172+
(github.event_name == 'workflow_dispatch' &&
173+
(github.event.inputs.type == 'all' || github.event.inputs.type == 'mac')))
169174
runs-on: ${{ matrix.config.image }}
170175
name: ${{ matrix.config.image }}
171176
env:

.github/workflows/nanovdb.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ on:
1818
- 'pendingchanges/**'
1919
- '**.md'
2020
pull_request:
21+
# Add 'ready_for_review' to run CI when a draft PR is marked ready.
22+
types: [opened, synchronize, reopened, ready_for_review]
2123
branches:
2224
- '**'
2325
paths-ignore:
@@ -44,10 +46,12 @@ concurrency:
4446

4547
jobs:
4648
linux-nanovdb:
49+
# push OR non-draft PR OR matching manual run
4750
if: |
48-
github.event_name != 'workflow_dispatch' ||
49-
github.event.inputs.type == 'all' ||
50-
github.event.inputs.type == 'linux'
51+
(github.event_name == 'push' ||
52+
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
53+
(github.event_name == 'workflow_dispatch' &&
54+
(github.event.inputs.type == 'all' || github.event.inputs.type == 'linux')))
5155
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
5256
name: >
5357
linux-nanovdb:cxx:${{ matrix.config.cxx }}-${{ matrix.config.build }}
@@ -92,9 +96,10 @@ jobs:
9296

9397
windows-nanovdb:
9498
if: |
95-
github.event_name != 'workflow_dispatch' ||
96-
github.event.inputs.type == 'all' ||
97-
github.event.inputs.type == 'win'
99+
(github.event_name == 'push' ||
100+
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
101+
(github.event_name == 'workflow_dispatch' &&
102+
(github.event.inputs.type == 'all' || github.event.inputs.type == 'win')))
98103
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'windows-2022-8c-32g-300h') || 'windows-latest' }}
99104
env:
100105
VCPKG_DEFAULT_TRIPLET: 'x64-windows'
@@ -139,9 +144,10 @@ jobs:
139144

140145
macos-nanovdb:
141146
if: |
142-
github.event_name != 'workflow_dispatch' ||
143-
github.event.inputs.type == 'all' ||
144-
github.event.inputs.type == 'mac'
147+
(github.event_name == 'push' ||
148+
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
149+
(github.event_name == 'workflow_dispatch' &&
150+
(github.event.inputs.type == 'all' || github.event.inputs.type == 'mac')))
145151
runs-on: ${{ matrix.config.runner }}
146152
env:
147153
CXX: ${{ matrix.config.cxx }}
@@ -168,9 +174,10 @@ jobs:
168174

169175
nanovdb-lite:
170176
if: |
171-
github.event_name != 'workflow_dispatch' ||
172-
github.event.inputs.type == 'all' ||
173-
github.event.inputs.type == 'linux'
177+
(github.event_name == 'push' ||
178+
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
179+
(github.event_name == 'workflow_dispatch' &&
180+
(github.event.inputs.type == 'all' || github.event.inputs.type == 'linux')))
174181
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
175182
container:
176183
image: aswf/ci-openvdb:2024-clang17.2

0 commit comments

Comments
 (0)