-
Notifications
You must be signed in to change notification settings - Fork 7
254 lines (234 loc) · 8.71 KB
/
health.yaml
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
245
246
247
248
249
250
251
252
253
254
# A CI configuration to check PR health. Check the docs at https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose#health.
name: Health
# Callers of this workflow should use it as follows:
#
# name: Health
# on:
# pull_request:
# branches: [ main ]
# types: [opened, synchronize, reopened, labeled, unlabeled]
# jobs:
# health:
# uses: dart-lang/ecosystem/.github/workflows/health.yaml@main
# Or with options:
#
# jobs:
# health:
# uses: dart-lang/ecosystem/.github/workflows/health.yaml@main
# with:
# sdk: beta
# checks: "version,changelog,license,coverage,breaking,do-not-submit,leaking"
# fail_on: "version,changelog,do-not-submit"
# warn_on: "license,coverage,breaking,leaking"
# coverage_web: false
# upload_coverage: false
# use-flutter: true
# use-flutter: true
# use-flutter: true
# ignore_license: "**.g.dart"
# ignore_coverage: "**.mock.dart,**.g.dart"
# ignore_packages: "pkgs/helper_package"
# checkout_submodules: false
# experiments: "native-assets"
on:
workflow_call:
inputs:
# Callers may optionally specify the version of the SDK to use when running the
# health check. This can be useful if your package has a very recent minimum SDK
# constraint. This is done via the `sdk` input parameter. Note that this
# parameter is not required; it defaults to `stable` - using the most recent
# stable release of the Dart SDK.
sdk:
description: >-
The channel, or a specific version from a channel, to install
('2.19.0','stable', 'beta', 'dev'). Using one of the three channels
will give you the latest version published to that channel.
default: "stable"
required: false
type: string
# Restrict the checks to any subset of version, changelog, and license if
# needed.
checks:
description: What to check for in the PR health check - any subset of "version,changelog,license,coverage,breaking,do-not-submit,leaking"
default: "version,changelog,license,coverage,breaking,do-not-submit,leaking"
type: string
required: false
fail_on:
description: Which checks should lead to failure - any subset of "version,changelog,license,coverage,breaking,do-not-submit,leaking"
default: "version,changelog,do-not-submit"
type: string
required: false
warn_on:
description: Which checks should not fail, but only warn - any subset of "version,changelog,license,coverage,breaking,do-not-submit,leaking"
default: "license,coverage,breaking,leaking"
type: string
required: false
local_debug:
description: Whether to use a local copy of package:firehose - only for debug
default: false
type: boolean
required: false
upload_coverage:
description: Whether to upload the coverage to coveralls
default: true
type: boolean
required: false
coverage_web:
description: Whether to run `dart test -p chrome` for coverage
default: false
type: boolean
required: false
use-flutter:
description: Whether to setup Flutter in this workflow.
default: false
required: false
type: boolean
ignore_license:
description: Which files to ignore for the license check.
default: "\"\""
required: false
type: string
ignore_coverage:
description: Which files to ignore for the coverage check.
default: "\"\""
required: false
type: string
ignore_packages:
description: Which packages to ignore.
default: "\"\""
required: false
type: string
checkout_submodules:
description: Whether to checkout submodules of git repositories.
default: false
required: false
type: boolean
experiments:
description: Which experiments should be enabled for Dart.
default: "\"\""
type: string
required: false
jobs:
version:
if: ${{ contains(inputs.checks, 'version') }}
uses: ./.github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
check: version
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
ignore_packages: ${{ inputs.ignore_packages }}
checkout_submodules: ${{ inputs.checkout_submodules }}
changelog:
if: ${{ contains(inputs.checks, 'changelog') }}
uses: ./.github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
check: changelog
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
ignore_packages: ${{ inputs.ignore_packages }}
checkout_submodules: ${{ inputs.checkout_submodules }}
license:
if: ${{ contains(inputs.checks, 'license') }}
uses: ./.github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
check: license
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
ignore_license: ${{ inputs.ignore_license }}
ignore_packages: ${{ inputs.ignore_packages }}
checkout_submodules: ${{ inputs.checkout_submodules }}
coverage:
if: ${{ contains(inputs.checks, 'coverage') }}
uses: ./.github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
check: coverage
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
upload_coverage: ${{ inputs.upload_coverage }}
coverage_web: ${{ inputs.coverage_web }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
ignore_coverage: ${{ inputs.ignore_coverage }}
ignore_packages: ${{ inputs.ignore_packages }}
checkout_submodules: ${{ inputs.checkout_submodules }}
experiments: ${{ inputs.experiments }}
breaking:
if: ${{ contains(inputs.checks, 'breaking') }}
uses: ./.github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
check: breaking
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
ignore_packages: ${{ inputs.ignore_packages }}
checkout_submodules: ${{ inputs.checkout_submodules }}
do-not-submit:
if: ${{ contains(inputs.checks, 'do-not-submit') }}
uses: ./.github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
check: do-not-submit
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
ignore_packages: ${{ inputs.ignore_packages }}
checkout_submodules: ${{ inputs.checkout_submodules }}
leaking:
if: ${{ contains(inputs.checks, 'leaking') }}
uses: ./.github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
check: leaking
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
ignore_packages: ${{ inputs.ignore_packages }}
checkout_submodules: ${{ inputs.checkout_submodules }}
comment:
needs: [version, changelog, license, coverage, breaking, do-not-submit, leaking]
if: always()
# These permissions are required for us to create comments on PRs.
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427
with:
path: single-comments
- run: ls -R single-comments
- name: Find Comment
uses: peter-evans/find-comment@bf21a578dd780f2e451dac9c1aa40a64c4285b75
id: fc
with:
issue-number: ${{ github.event.number }}
comment-author: github-actions[bot]
body-includes: '## PR Health'
- name: Merge all single comments
run: |
mkdir output
echo $'## PR Health \n\n' >> output/comment.md
cat single-comments/*/*.md >> output/comment.md
echo ${{ github.event.number }} > output/issueNumber
- name: Write comment id to file
if: ${{ steps.fc.outputs.comment-id != 0 }}
run: echo ${{ steps.fc.outputs.comment-id }} >> output/commentId
- name: Upload folder with number and markdown
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: output
path: output/