-
Notifications
You must be signed in to change notification settings - Fork 8
163 lines (136 loc) · 4.7 KB
/
check-pr.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
name: check-pr
on:
pull_request:
concurrency:
group: check-pr-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
uses: ./.github/workflows/wc-changes.yml
skip-comment:
runs-on: ubuntu-22.04
needs: changes
if: ${{ needs.changes.outputs.any == 'false' }}
permissions:
pull-requests: write
timeout-minutes: 5
steps:
# https://github.com/peter-evans/create-or-update-comment
- name: Comment
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
チェック対象ファイルの変更がなかったため、checkジョブをスキップしました
check-actions:
runs-on: ubuntu-22.04
needs: changes
if: ${{ needs.changes.outputs.actions == 'true' }}
timeout-minutes: 10
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# https://github.com/marketplace/actions/actionlint-with-reviewdog
- uses: reviewdog/action-actionlint@4f8f9963ca57a41e5fd5b538dd79dbfbd3e0b38a # v1.54.0
with:
actionlint_flags: -ignore 'SC2153'
fail_on_error: true
filter_mode: nofilter
level: error
reporter: github-pr-review
cache-dependencies:
runs-on: ubuntu-22.04
needs: changes
if: ${{ needs.changes.outputs.dependencies == 'true' }}
timeout-minutes: 10
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Setup Application Runtime
uses: ./.github/actions/setup-application-runtime
check:
needs:
- changes
- cache-dependencies
if: ${{ needs.changes.outputs.src == 'true' }}
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
# https://github.com/actions/checkout
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Application Runtime
uses: ./.github/actions/setup-application-runtime
# https://github.com/invertase/github-action-dart-analyzer
- name: Report analyze
uses: invertase/github-action-dart-analyzer@e981b01a458d0bab71ee5da182e5b26687b7101b # v3.0.0
with:
fatal-infos: true
- name: Check format
run: melos format --output none --set-exit-if-changed
- name: Run test
run: melos run report_test --no-select
continue-on-error: true
# https://github.com/andstor/file-existence-action
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
with:
# https://github.com/isaacs/node-glob の形式
files: "**/test_report.log"
# https://github.com/dorny/test-reporter
- name: Report test
if: steps.check_files.outputs.files_exists == 'true'
uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8 # v1.8.0
with:
name: "flutter test"
# https://github.com/mrmlnc/fast-glob の形式
path: "(apps|packages)/**/test_report.log"
reporter: "flutter-json"
fail-on-error: "true"
# custom_lintが時間かかるのでcheckと並列させる
custom-lint:
needs:
- changes
- cache-dependencies
if: ${{ needs.changes.outputs.lint == 'true' }}
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
# https://github.com/actions/checkout
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Application Runtime
uses: ./.github/actions/setup-application-runtime
- name: Report custom_lint result
run: |
echo "::add-matcher::.github/problem_matchers/custom_lint.json"
melos run report_custom_lint:ci --no-select || result=$?
echo "::remove-matcher owner=custom_lint::"
if [ -n "$result" ]; then
exit 1
fi
diff-gen:
uses: ./.github/workflows/wc-check-diff.yaml
needs:
- changes
- cache-dependencies
if: ${{ needs.changes.outputs.gen == 'true' }}
markdown:
uses: ./.github/workflows/wc-check-markdown.yaml
needs: changes
if: ${{ needs.changes.outputs.markdown == 'true' }}
status-check:
runs-on: ubuntu-22.04
needs:
- check-actions
- check
- custom-lint
- diff-gen
- markdown
permissions: { }
if: failure()
steps:
- run: exit 1