Skip to content

Commit 6184746

Browse files
authored
Merge pull request #836 from wireapp/wpb-22405-git-lable
WPB-22405: Add level based approach to run CI deployment pipeline on a PR
2 parents 84f70b7 + 40a5d48 commit 6184746

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ Fixes ${ISSUE_URL}
2121
* [ ] I ran/applied the changes myself, in a test environment.
2222
* [ ] The CI job attached to this repo will test it for me.
2323

24+
#### Offline Build CI (label-based)
25+
Add one or more labels to trigger offline builds:
26+
- `build-default` - Full production build (ansible, terraform, all packages)
27+
- `build-demo` - Demo/WIAB build
28+
- `build-min` - Minimal build (fastest, essential charts only)
29+
- `build-all` - Run all three builds
30+
31+
**Note:** No builds run by default. Add a label to trigger CI.
32+
2433
### Tracking
2534

2635
* [ ] I added a new entry in an appropriate subdirectory of `changelog.d`

.github/workflows/offline.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
# - min: Minimal deployment
77
#
88
# Build Optimization via PR Labels:
9-
# - No label: Builds default + demo + min (all profiles)
10-
# - 'demo-only': Builds only demo profile
11-
# - 'min-only': Builds only min profile
9+
# - No label: No builds run (must add label to trigger builds)
10+
# - 'build-default': Builds only default profile
11+
# - 'build-demo': Builds only demo profile
12+
# - 'build-min': Builds only min profile
1213
# - 'build-all': Explicitly builds all profiles (useful for workflow changes)
1314
#
1415
# Push to master/develop: Always builds all profiles regardless of labels
@@ -21,6 +22,7 @@ on:
2122
- "*.md"
2223
- "**/*.md"
2324
pull_request:
25+
types: [synchronize, reopened, labeled]
2426
branches: [master, develop]
2527
paths-ignore:
2628
- "*.md"
@@ -30,11 +32,9 @@ jobs:
3032
build-default:
3133
name: Build default profile
3234
if: |
33-
!contains(github.event.head_commit.message, 'skip ci') &&
34-
(github.event_name == 'push' ||
35-
contains(github.event.pull_request.labels.*.name, 'build-all') ||
36-
(!contains(github.event.pull_request.labels.*.name, 'demo-only') &&
37-
!contains(github.event.pull_request.labels.*.name, 'min-only')))
35+
github.event_name == 'push' ||
36+
contains(github.event.pull_request.labels.*.name, 'build-all') ||
37+
contains(github.event.pull_request.labels.*.name, 'build-default')
3838
runs-on:
3939
group: wire-server-deploy
4040
outputs:
@@ -118,11 +118,9 @@ jobs:
118118
build-demo:
119119
name: Build demo profile
120120
if: |
121-
!contains(github.event.head_commit.message, 'skip ci') &&
122-
(github.event_name == 'push' ||
123-
contains(github.event.pull_request.labels.*.name, 'build-all') ||
124-
contains(github.event.pull_request.labels.*.name, 'demo-only') ||
125-
!contains(github.event.pull_request.labels.*.name, 'min-only'))
121+
github.event_name == 'push' ||
122+
contains(github.event.pull_request.labels.*.name, 'build-all') ||
123+
contains(github.event.pull_request.labels.*.name, 'build-demo')
126124
runs-on:
127125
group: wire-server-deploy
128126
steps:
@@ -181,11 +179,9 @@ jobs:
181179
build-min:
182180
name: Build min profile
183181
if: |
184-
!contains(github.event.head_commit.message, 'skip ci') &&
185-
(github.event_name == 'push' ||
186-
contains(github.event.pull_request.labels.*.name, 'build-all') ||
187-
contains(github.event.pull_request.labels.*.name, 'min-only') ||
188-
!contains(github.event.pull_request.labels.*.name, 'demo-only'))
182+
github.event_name == 'push' ||
183+
contains(github.event.pull_request.labels.*.name, 'build-all') ||
184+
contains(github.event.pull_request.labels.*.name, 'build-min')
189185
runs-on:
190186
group: wire-server-deploy
191187
steps:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Changed: offline workflow to require explicit labels for PR builds (build-default, build-demo, build-min, build-all); PRs without labels no longer trigger builds

0 commit comments

Comments
 (0)