-
Notifications
You must be signed in to change notification settings - Fork 6
135 lines (121 loc) · 4.25 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
# A CI configuration to check PR 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
# with:
# coverage_web: true #If the coverage should run browser tests
# 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.
#
# The checks can also be restricted to any subset of version, changelog, and license,
# if needed.
#
# jobs:
# health:
# uses: dart-lang/ecosystem/.github/workflows/health.yaml@main
# with:
# sdk: beta
# checks: "version,changelog,license,coverage,breaking,do-not-submit"
on:
workflow_call:
inputs:
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
checks:
description: What to check for in the PR health check - any subset of "version,changelog,license,coverage,breaking,do-not-submit"
default: "version,changelog,license,coverage,breaking,do-not-submit"
type: string
required: false
fail_on:
description: Which checks should lead to failure - any subset of "version,changelog,license,coverage,breaking,do-not-submit"
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"
default: "license,coverage,breaking"
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
jobs:
version:
if: contains(${{ inputs.checks }}, 'version')
runs-on: ubuntu-latest
steps:
- uses: dart-lang/ecosystem/.github/workflows/health_base.yaml@healthUpdates
with:
sdk: ${{ inputs.sdk }}
checks: version
fail: false
local_debug: ${{ inputs.local_debug }}
license:
if: contains(${{ inputs.checks }}, 'license')
runs-on: ubuntu-latest
steps:
- uses: dart-lang/ecosystem/.github/workflows/health_base.yaml@healthUpdates
with:
sdk: ${{ inputs.sdk }}
checks: license
fail: false
local_debug: ${{ inputs.local_debug }}
comment:
needs: [version, license]
# 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@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110
with:
path: single-comments
pattern: comment-*
merge-multiple: true
- name: Merge all single comments
run: |
mkdir output
echo $'## PR Health \n\n' >> my_file.txt
cat single-comments/* >> output/comment.md
echo ${{ github.event.number }} > output/issueNumber
- name: Upload folder with number and markdown
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392
with:
name: output
path: output/