-
Notifications
You must be signed in to change notification settings - Fork 677
244 lines (193 loc) · 8.34 KB
/
pr-differences-mutants.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
name: PR Differences Mutants
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
paths:
- '**.rs'
workflow_dispatch:
concurrency:
group: pr-differences-${{ github.head_ref || github.ref || github.run_id }}
# Always cancel duplicate jobs
cancel-in-progress: true
jobs:
check-access-permissions:
name: Check Access Permissions
runs-on: ubuntu-latest
steps:
- name: Check Access Permissions To Trigger This
id: check_access_permissions
uses: stacks-network/actions/team-membership@main
with:
username: ${{ github.actor }}
team: 'blockchain-team'
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
outputs:
ignore_timeout: ${{ steps.check_access_permissions.outputs.is_team_member == 'true' && github.event_name == 'workflow_dispatch' }}
# Check and output whether to run big (`stacks-node`/`stackslib`) or small (others) packages with or without shards
check-big-packages-and-shards:
name: Check Packages and Shards
needs: check-access-permissions
runs-on: ubuntu-latest
outputs:
run_stackslib: ${{ steps.check_packages_and_shards.outputs.run_stackslib }}
stackslib_with_shards: ${{ steps.check_packages_and_shards.outputs.stackslib_with_shards }}
run_stacks_node: ${{ steps.check_packages_and_shards.outputs.run_stacks_node }}
stacks_node_with_shards: ${{ steps.check_packages_and_shards.outputs.stacks_node_with_shards }}
run_small_packages: ${{ steps.check_packages_and_shards.outputs.run_small_packages }}
small_packages_with_shards: ${{ steps.check_packages_and_shards.outputs.small_packages_with_shards }}
run_stacks_signer: ${{ steps.check_packages_and_shards.outputs.run_stacks_signer }}
too_many_mutants: ${{ steps.check_packages_and_shards.outputs.too_many_mutants }}
steps:
- id: check_packages_and_shards
uses: stacks-network/actions/stacks-core/mutation-testing/check-packages-and-shards@main
with:
ignore_timeout: ${{ needs.check-access-permissions.outputs.ignore_timeout }}
# Mutation testing - Execute on PR on small packages that have functions modified (normal run, no shards)
pr-differences-mutants-small-normal:
name: Mutation Testing - Normal, Small
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_small_packages == 'true' &&
needs.check-big-packages-and-shards.outputs.small_packages_with_shards == 'false'
runs-on: ubuntu-latest
steps:
- name: Run mutants on diffs
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@main
with:
package: 'small'
# Mutation testing - Execute on PR on small packages that have functions modified (run with strategy matrix shards)
pr-differences-mutants-small-shards:
name: Mutation Testing - Shards, Small
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_small_packages == 'true' &&
needs.check-big-packages-and-shards.outputs.small_packages_with_shards == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3]
steps:
- name: Run mutants on diffs
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@main
with:
shard: ${{ matrix.shard }}
package: 'small'
# Mutation testing - Execute on PR on stackslib package (normal run, no shards)
pr-differences-mutants-stackslib-normal:
name: Mutation Testing - Normal, Stackslib
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_stackslib == 'true' &&
needs.check-big-packages-and-shards.outputs.stackslib_with_shards == 'false'
runs-on: ubuntu-latest
steps:
- name: Run Run mutants on diffs
env:
BITCOIND_TEST: 1
RUST_BACKTRACE: full
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@main
with:
package: 'stackslib'
# Mutation testing - Execute on PR on stackslib package (run with strategy matrix shards)
pr-differences-mutants-stackslib-shards:
name: Mutation Testing - Shards, Stackslib
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_stackslib == 'true' &&
needs.check-big-packages-and-shards.outputs.stackslib_with_shards == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3, 4, 5, 6, 7]
steps:
- name: Run mutants on diffs
env:
BITCOIND_TEST: 1
RUST_BACKTRACE: full
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@main
with:
shard: ${{ matrix.shard }}
package: 'stackslib'
# Mutation testing - Execute on PR on stacks-node package (normal run, no shards)
pr-differences-mutants-stacks-node-normal:
name: Mutation Testing - Normal, Stacks Node
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_stacks_node == 'true' &&
needs.check-big-packages-and-shards.outputs.stacks_node_with_shards == 'false'
runs-on: ubuntu-latest
steps:
- name: Run Run mutants on diffs
env:
BITCOIND_TEST: 1
RUST_BACKTRACE: full
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@main
with:
package: 'stacks-node'
# Mutation testing - Execute on PR on stacks-node package (run with strategy matrix shards)
pr-differences-mutants-stacks-node-shards:
name: Mutation Testing - Shards, Stacks Node
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_stacks_node == 'true' &&
needs.check-big-packages-and-shards.outputs.stacks_node_with_shards == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3]
steps:
- name: Run mutants on diffs
env:
BITCOIND_TEST: 1
RUST_BACKTRACE: full
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@main
with:
shard: ${{ matrix.shard }}
package: 'stacks-node'
# Mutation testing - Execute on PR on stacks-signer package (normal run, no shards)
pr-differences-mutants-stacks-signer-normal:
name: Mutation Testing - Normal, Stacks Signer
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_stacks_signer == 'true'
runs-on: ubuntu-latest
steps:
- name: Run mutants on diffs
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@main
with:
package: 'stacks-signer'
# Output the mutants and fail the workflow if there are missed/timeout/unviable mutants
output-mutants:
name: Output Mutants
runs-on: ubuntu-latest
if: always()
needs:
[
check-big-packages-and-shards,
pr-differences-mutants-small-normal,
pr-differences-mutants-small-shards,
pr-differences-mutants-stackslib-normal,
pr-differences-mutants-stackslib-shards,
pr-differences-mutants-stacks-node-normal,
pr-differences-mutants-stacks-node-shards,
pr-differences-mutants-stacks-signer-normal,
]
steps:
- name: Output Mutants
uses: stacks-network/actions/stacks-core/mutation-testing/output-pr-mutants@main
with:
stackslib_package: ${{ needs.check-big-packages-and-shards.outputs.run_stackslib }}
shards_for_stackslib_package: ${{ needs.check-big-packages-and-shards.outputs.stackslib_with_shards }}
stacks_node_package: ${{ needs.check-big-packages-and-shards.outputs.run_stacks_node }}
shards_for_stacks_node_package: ${{ needs.check-big-packages-and-shards.outputs.stacks_node_with_shards }}
small_packages: ${{ needs.check-big-packages-and-shards.outputs.run_small_packages }}
shards_for_small_packages: ${{ needs.check-big-packages-and-shards.outputs.small_packages_with_shards }}
stacks_signer: ${{ needs.check-big-packages-and-shards.outputs.run_stacks_signer }}
too_many_mutants: ${{ needs.check-big-packages-and-shards.outputs.too_many_mutants }}