-
Notifications
You must be signed in to change notification settings - Fork 70
288 lines (286 loc) · 11.9 KB
/
analyze-dependents.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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
name: Analyze Dependents
on:
workflow_dispatch:
schedule:
- cron: "0 14 * * *" # daily at 10am EST (Github Actions works with UTC)
jobs:
# clones known dependent Git repositories from Open edX
checkout-dependents:
runs-on: ubuntu-latest
steps:
- name: Checkout openedx/credentials-themes
uses: actions/checkout@v3
with:
repository: openedx/credentials-themes
path: dependent-usage-analyzer/.projects/credentials-themes
- name: Checkout openedx/credentials
uses: actions/checkout@v3
with:
repository: openedx/credentials
path: dependent-usage-analyzer/.projects/credentials
- name: Checkout openedx/edx-enterprise
uses: actions/checkout@v3
with:
repository: openedx/edx-enterprise
path: dependent-usage-analyzer/.projects/edx-enterprise
- name: Checkout openedx/edx-ora2
uses: actions/checkout@v3
with:
repository: openedx/edx-ora2
path: dependent-usage-analyzer/.projects/edx-ora2
- name: Checkout openedx/edx-platform
uses: actions/checkout@v3
with:
repository: openedx/edx-platform
path: dependent-usage-analyzer/.projects/edx-platform
- name: Checkout openedx/frontend-app-account
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-account
path: dependent-usage-analyzer/.projects/frontend-app-account
- name: Checkout openedx/frontend-app-admin-portal
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-admin-portal
path: dependent-usage-analyzer/.projects/frontend-app-admin-portal
- name: Checkout openedx/frontend-app-authn
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-authn
path: dependent-usage-analyzer/.projects/frontend-app-authn
- name: Checkout openedx/frontend-app-communications
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-communications
path: dependent-usage-analyzer/.projects/frontend-app-communications
- name: Checkout openedx/frontend-app-course-authoring
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-course-authoring
path: dependent-usage-analyzer/.projects/frontend-app-course-authoring
- name: Checkout openedx/frontend-app-discussions
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-discussions
path: dependent-usage-analyzer/.projects/frontend-app-discussions
- name: Checkout openedx/frontend-app-ecommerce
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-ecommerce
path: dependent-usage-analyzer/.projects/frontend-app-ecommerce
- name: Checkout openedx/frontend-app-enterprise-public-catalog
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-enterprise-public-catalog
path: dependent-usage-analyzer/.projects/frontend-app-enterprise-public-catalog
- name: Checkout openedx/frontend-app-gradebook
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-gradebook
path: dependent-usage-analyzer/.projects/frontend-app-gradebook
- name: Checkout openedx/frontend-app-learner-portal-enterprise
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-learner-portal-enterprise
path: dependent-usage-analyzer/.projects/frontend-app-learner-portal-enterprise
- name: Checkout openedx/frontend-app-learner-portal-programs
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-learner-portal-programs
path: dependent-usage-analyzer/.projects/frontend-app-learner-portal-programs
- name: Checkout openedx/frontend-app-learner-record
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-learner-record
path: dependent-usage-analyzer/.projects/frontend-app-learner-record
- name: Checkout openedx/frontend-app-learning
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-learning
path: dependent-usage-analyzer/.projects/frontend-app-learning
- name: Checkout openedx/frontend-app-library-authoring
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-library-authoring
path: dependent-usage-analyzer/.projects/frontend-app-library-authoring
- name: Checkout openedx/frontend-app-ora-grading
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-ora-grading
path: dependent-usage-analyzer/.projects/frontend-app-ora-grading
- name: Checkout openedx/frontend-app-payment
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-payment
path: dependent-usage-analyzer/.projects/frontend-app-payment
- name: Checkout openedx/frontend-app-profile
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-profile
path: dependent-usage-analyzer/.projects/frontend-app-profile
- name: Checkout openedx/frontend-app-program-console
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-program-console
path: dependent-usage-analyzer/.projects/frontend-app-program-console
- name: Checkout openedx/frontend-app-publisher
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-publisher
path: dependent-usage-analyzer/.projects/frontend-app-publisher
- name: Checkout openedx/frontend-app-support-tools
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-support-tools
path: dependent-usage-analyzer/.projects/frontend-app-support-tools
- name: Checkout openedx/frontend-component-cookie-policy-banner
uses: actions/checkout@v3
with:
repository: openedx/frontend-component-cookie-policy-banner
path: dependent-usage-analyzer/.projects/frontend-component-cookie-policy-banner
- name: Checkout edx/frontend-component-header-edx
uses: actions/checkout@v3
with:
repository: edx/frontend-component-header-edx
path: dependent-usage-analyzer/.projects/frontend-component-header-edx
- name: Checkout openedx/frontend-component-header
uses: actions/checkout@v3
with:
repository: openedx/frontend-component-header
path: dependent-usage-analyzer/.projects/frontend-component-header
- name: Checkout openedx/frontend-enterprise
uses: actions/checkout@v3
with:
repository: openedx/frontend-enterprise
path: dependent-usage-analyzer/.projects/frontend-enterprise
- name: Checkout openedx/frontend-learner-portal-base
uses: actions/checkout@v3
with:
repository: openedx/frontend-learner-portal-base
path: dependent-usage-analyzer/.projects/frontend-learner-portal-base
- name: Checkout openedx/frontend-lib-special-exams
uses: actions/checkout@v3
with:
repository: openedx/frontend-lib-special-exams
path: dependent-usage-analyzer/.projects/frontend-lib-special-exams
- name: Checkout openedx/frontend-platform
uses: actions/checkout@v3
with:
repository: openedx/frontend-platform
path: dependent-usage-analyzer/.projects/frontend-platform
- name: Checkout openedx/frontend-template-application
uses: actions/checkout@v3
with:
repository: openedx/frontend-template-application
path: dependent-usage-analyzer/.projects/frontend-template-application
- name: Checkout edx/prospectus
uses: actions/checkout@v3
with:
repository: edx/prospectus
path: dependent-usage-analyzer/.projects/prospectus
token: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
- name: Checkout openedx/studio-frontend
uses: actions/checkout@v3
with:
repository: openedx/studio-frontend
path: dependent-usage-analyzer/.projects/studio-frontend
- name: Checkout openedx/frontend-app-communications
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-communications
path: dependent-usage-analyzer/.projects/frontend-app-communications
- name: Checkout openedx/frontend-app-learner-dashboard
uses: actions/checkout@v3
with:
repository: openedx/frontend-app-learner-dashboard
path: dependent-usage-analyzer/.projects/frontend-app-learner-dashboard
- name: Verify checkouts
working-directory: dependent-usage-analyzer
run: ls -la .projects
- name: Create zip archive of dependent project checkouts
uses: montudor/action-zip@v1
with:
args: zip -qq -r dependent-usage-analyzer/dependent-projects.zip dependent-usage-analyzer/.projects
- name: Upload dependent projects checkouts
uses: actions/upload-artifact@v4
with:
name: dependent-project-checkouts
path: dependent-usage-analyzer/dependent-projects.zip
# analyzes the dependent Git repositories
analyze-dependents:
needs: checkout-dependents
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Nodejs Env
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VER }}
- name: Install dependencies
run: npm ci
working-directory: dependent-usage-analyzer
- name: Download dependent project checkouts
uses: actions/download-artifact@v4
with:
name: dependent-project-checkouts
path: dependent-usage-analyzer
- name: Unzip archive of dependent project checkouts
uses: montudor/action-zip@v1
with:
args: unzip -qq dependent-usage-analyzer/dependent-projects.zip -d dependent-usage-analyzer/dependent-projects
- name: Move dependent project checkouts
working-directory: dependent-usage-analyzer
run: |
sudo mv dependent-projects/dependent-usage-analyzer/.projects .projects
ls -la .projects
- name: Analyze projects
run: npm run analyze .projects -- --out "${GITHUB_WORKSPACE}/dependent-usage.json"
working-directory: dependent-usage-analyzer
- name: Upload analysis output
uses: actions/upload-artifact@v4
with:
name: dependent-usage-json
path: dependent-usage.json
# automatically open, approve, and merge a PR with the dependent projects analysis output
commit-dependents-analysis:
needs: analyze-dependents
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Nodejs Env
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VER }}
- name: Download analysis output
uses: actions/download-artifact@v4
with:
name: dependent-usage-json
- name: Create pull request for dependent project usages
id: cpr
uses: peter-evans/create-pull-request@v3
with:
commit-message: "docs: update dependent-usage.json"
title: "docs: update dependent-usage.json"
body: "Contains automated changes to the dependent-usage.json file, which provides the data for Paragon Usage Insights."
labels: automerge
branch: dependent-usage-analyzer/update-dependent-usage-json
base: master
- name: Auto-approve pull request for dependent project usages
uses: hmarr/auto-approve-action@v2
with:
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
github-token: ${{ secrets.requirements_bot_github_token }}
- name: Auto-merge pull request for dependent project usages
uses: pascalgn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.requirements_bot_github_token }}
MERGE_METHOD: squash
MERGE_RETRY_SLEEP: 240000