Commit cb858f9
committed
Start only the matching e2e suite when its label is added
Adding test-e2e, test-ark or test-ngts to an open pull request currently
does nothing. The workflow uses `on: pull_request: {}`, which takes the
default activity types of opened, synchronize and reopened. There is no
`labeled`, so the label sits on the pull request and no run starts.
Re-running the workflow does not help either, because a re-run replays
the original event payload, which had no labels. The only way through is
to close and reopen the pull request, or push a commit. The failure mode
is silent, so it looks like the job is broken.
Add `labeled` to the activity types, and make each job decide what a
label event means for it:
- verify and test skip, because a label says nothing about the code.
- each e2e job runs only when github.event.label.name, the single
label that was just added, is its own label.
github.event.action is null on push and on workflow_dispatch, so both
guards only ever exclude the label event. Behaviour on push, on
workflow_dispatch and on opened/synchronize/reopened is unchanged, so an
e2e suite whose label is already on the pull request still re-runs on
every new commit.
The trigger itself cannot be filtered by label name, so adding an
unrelated label still creates a workflow run. Every job in it skips, and
a skipped job never claims a runner.
One ordering note: add keep-e2e-cluster before test-e2e, not after.
Adding it afterwards starts nothing, because it matches no job.
Signed-off-by: Richard Wall <richard.wall@cyberark.com>1 parent da60d34 commit cb858f9
1 file changed
Lines changed: 40 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
6 | 19 | | |
7 | 20 | | |
8 | 21 | | |
9 | 22 | | |
10 | 23 | | |
11 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
12 | 29 | | |
13 | 30 | | |
14 | 31 | | |
| |||
39 | 56 | | |
40 | 57 | | |
41 | 58 | | |
| 59 | + | |
| 60 | + | |
42 | 61 | | |
43 | 62 | | |
44 | 63 | | |
| |||
84 | 103 | | |
85 | 104 | | |
86 | 105 | | |
87 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
88 | 114 | | |
89 | 115 | | |
90 | 116 | | |
| |||
122 | 148 | | |
123 | 149 | | |
124 | 150 | | |
125 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
126 | 157 | | |
127 | 158 | | |
128 | 159 | | |
| |||
157 | 188 | | |
158 | 189 | | |
159 | 190 | | |
160 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
161 | 197 | | |
162 | 198 | | |
163 | 199 | | |
| |||
0 commit comments