-
Notifications
You must be signed in to change notification settings - Fork 10
359 lines (334 loc) · 14.7 KB
/
interoperability-report.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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
name: Interoperability Report
on:
workflow_dispatch:
schedule:
# Every day at midnight
- cron: '0 0 * * *'
jobs:
interop-did-web-discovery:
name: DID Web Discovery
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: 'Mavennet'
actor: 'MAVENNET_STAGING'
- name: 'mesur.io'
actor: 'MESUR_IO_PRODUCTION'
- name: 'GS1US'
actor: 'GS1US'
- name: 'BCGov'
actor: 'BCGOV'
steps:
# Check out repo, setup node, and install dependencies.
# @see https://github.com/actions/setup-node#usage
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.15.1
cache: 'npm'
- run: npm ci
- name: Run Tests
env:
organization_did_web: ${{secrets[format('{0}_ORGANIZATION_DID_WEB', matrix.actor)]}}
client_id: ${{secrets[format('{0}_CLIENT_ID', matrix.actor)]}}
client_secret: ${{secrets[format('{0}_CLIENT_SECRET', matrix.actor)]}}
client_scope: ${{secrets[format('{0}_CLIENT_SCOPE', matrix.actor)]}}
token_audience: ${{secrets[format('{0}_TOKEN_AUDIENCE', matrix.actor)]}}
token_endpoint: ${{secrets[format('{0}_TOKEN_ENDPOINT', matrix.actor)]}}
api_base_url: ${{secrets[format('{0}_API_BASE_URL', matrix.actor)]}}
run: |
npx newman run ./docs/tutorials/did-web-discovery/did-web-discovery.postman_collection.json \
--env-var ORGANIZATION_DID_WEB=$organization_did_web \
--env-var CLIENT_ID=$client_id \
--env-var CLIENT_SECRET=$client_secret \
--env-var CLIENT_SCOPE=$client_scope \
--env-var TOKEN_AUDIENCE=$token_audience \
--env-var TOKEN_ENDPOINT=$token_endpoint \
--env-var API_BASE_URL=$api_base_url \
--reporters cli,htmlextra,json \
--reporter-htmlextra-skipSensitiveData \
--reporter-htmlextra-export "newman/${{format('{0}-{1}-{2}.html', github.run_id, github.job, matrix.name)}}" \
--reporter-json-export "newman/${{format('{0}-{1}-{2}.json', github.run_id, github.job, matrix.name)}}"
# Write sanitized Newman output to `./docs/reports`.
- name: Sanitize Report Output
if: always() # Run even when postman tests fail
run: npm run report:sanitize
# Sanitized reports are needed by subsequent jobs
- uses: actions/upload-artifact@v3
if: always() # Run even when postman tests fail
with:
name: reports
path: docs/reports/
interop-presentations-exchange-oauth:
name: Presentations Exchange OAuth
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: 'mesur.io-Mavennet'
holder: MESUR_IO_PRODUCTION
verifier: MAVENNET_STAGING
- name: 'mesur.io-GS1US'
holder: MESUR_IO_PRODUCTION
verifier: GS1US
- name: 'mesur.io-BCGov'
holder: MESUR_IO_PRODUCTION
verifier: BCGOV
- name: 'Mavennet-mesur.io'
holder: MAVENNET_STAGING
verifier: MESUR_IO_PRODUCTION
- name: 'Mavennet-GS1US'
holder: MAVENNET_STAGING
verifier: GS1US
- name: 'Mavennet-BCGov'
holder: MAVENNET_STAGING
verifier: BCGOV
- name: 'GS1US-mesur.io'
holder: GS1US
verifier: MESUR_IO_PRODUCTION
- name: 'GS1US-BCGov'
holder: GS1US
verifier: BCGOV
- name: 'BCGov-mesur.io'
holder: BCGOV
verifier: MESUR_IO_PRODUCTION
- name: 'BCGov-Mavennet'
holder: BCGOV
verifier: MAVENNET_STAGING
- name: 'BCGov-GS1US'
holder: BCGOV
verifier: GS1US
steps:
# Check out repo, setup node, and install dependencies.
# @see https://github.com/actions/setup-node#usage
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.15.1
cache: 'npm'
- run: npm ci
- name: Run Tests
env:
holder_organization_did_web: ${{secrets[format('{0}_ORGANIZATION_DID_WEB', matrix.holder)]}}
holder_client_id: ${{secrets[format('{0}_CLIENT_ID', matrix.holder)]}}
holder_client_secret: ${{secrets[format('{0}_CLIENT_SECRET', matrix.holder)]}}
holder_client_scope: ${{secrets[format('{0}_CLIENT_SCOPE', matrix.actor)]}}
holder_token_audience: ${{secrets[format('{0}_TOKEN_AUDIENCE', matrix.holder)]}}
holder_token_endpoint: ${{secrets[format('{0}_TOKEN_ENDPOINT', matrix.holder)]}}
holder_api_base_url: ${{secrets[format('{0}_API_BASE_URL', matrix.holder)]}}
verifier_organization_did_web: ${{secrets[format('{0}_ORGANIZATION_DID_WEB', matrix.verifier)]}}
verifier_client_id: ${{secrets[format('{0}_CLIENT_ID', matrix.verifier)]}}
verifier_client_secret: ${{secrets[format('{0}_CLIENT_SECRET', matrix.verifier)]}}
verifier_client_scope: ${{secrets[format('{0}_CLIENT_SCOPE', matrix.actor)]}}
verifier_token_audience: ${{secrets[format('{0}_TOKEN_AUDIENCE', matrix.verifier)]}}
verifier_token_endpoint: ${{secrets[format('{0}_TOKEN_ENDPOINT', matrix.verifier)]}}
verifier_api_base_url: ${{secrets[format('{0}_API_BASE_URL', matrix.verifier)]}}
run: |
npx newman run ./docs/tutorials/presentations-exchange-oauth/presentations-exchange-oauth.json \
--env-var HOLDER_ORGANIZATION_DID_WEB=$holder_organization_did_web \
--env-var HOLDER_CLIENT_ID=$holder_client_id \
--env-var HOLDER_CLIENT_SECRET=$holder_client_secret \
--env-var HOLDER_CLIENT_SCOPE=$holder_client_scope \
--env-var HOLDER_TOKEN_AUDIENCE=$holder_token_audience \
--env-var HOLDER_TOKEN_ENDPOINT=$holder_token_endpoint \
--env-var HOLDER_API_BASE_URL=$holder_api_base_url \
--env-var VERIFIER_ORGANIZATION_DID_WEB=$verifier_organization_did_web \
--env-var VERIFIER_CLIENT_ID=$verifier_client_id \
--env-var VERIFIER_CLIENT_SECRET=$verifier_client_secret \
--env-var VERIFIER_CLIENT_SCOPE=$verifier_client_scope \
--env-var VERIFIER_TOKEN_AUDIENCE=$verifier_token_audience \
--env-var VERIFIER_TOKEN_ENDPOINT=$verifier_token_endpoint \
--env-var VERIFIER_API_BASE_URL=$verifier_api_base_url \
--reporters cli,htmlextra,json \
--reporter-htmlextra-skipSensitiveData \
--reporter-htmlextra-export "newman/${{format('{0}-{1}-{2}.html', github.run_id, github.job, matrix.name)}}" \
--reporter-json-export "newman/${{format('{0}-{1}-{2}.json', github.run_id, github.job, matrix.name)}}"
# Write sanitized Newman output to `./docs/reports`.
- name: Sanitize Report Output
if: always() # Run even when postman tests fail
run: npm run report:sanitize
# Sanitized reports are needed by subsequent jobs
- uses: actions/upload-artifact@v3
if: always() # Run even when postman tests fail
with:
name: reports
path: docs/reports/
traceable-presentation-workflow:
name: Traceable Presentation Workflow
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: 'Mavennet'
actor: 'MAVENNET_STAGING'
- name: 'mesur.io'
actor: 'MESUR_IO_PRODUCTION'
- name: 'GS1US'
actor: 'GS1US'
- name: 'BCGov'
actor: 'BCGOV'
steps:
# Check out repo, setup node, and install dependencies.
# @see https://github.com/actions/setup-node#usage
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.15.1
cache: 'npm'
- run: npm ci
- name: Run Tests
env:
organization_did_web: ${{secrets[format('{0}_ORGANIZATION_DID_WEB', matrix.actor)]}}
client_id: ${{secrets[format('{0}_CLIENT_ID', matrix.actor)]}}
client_secret: ${{secrets[format('{0}_CLIENT_SECRET', matrix.actor)]}}
client_scope: ${{secrets[format('{0}_CLIENT_SCOPE', matrix.actor)]}}
token_audience: ${{secrets[format('{0}_TOKEN_AUDIENCE', matrix.actor)]}}
token_endpoint: ${{secrets[format('{0}_TOKEN_ENDPOINT', matrix.actor)]}}
api_base_url: ${{secrets[format('{0}_API_BASE_URL', matrix.actor)]}}
run: |
npx newman run ./docs/tutorials/traceable-presentation-workflow/traceable-presentation-workflow.postman_collection.json \
--env-var ORGANIZATION_DID_WEB=$organization_did_web \
--env-var CLIENT_ID=$client_id \
--env-var CLIENT_SECRET=$client_secret \
--env-var CLIENT_SCOPE=$client_scope \
--env-var TOKEN_AUDIENCE=$token_audience \
--env-var TOKEN_ENDPOINT=$token_endpoint \
--env-var API_BASE_URL=$api_base_url \
--reporters cli,htmlextra,json \
--reporter-htmlextra-skipSensitiveData \
--reporter-htmlextra-export "newman/${{format('{0}-{1}-{2}.html', github.run_id, github.job, matrix.name)}}" \
--reporter-json-export "newman/${{format('{0}-{1}-{2}.json', github.run_id, github.job, matrix.name)}}"
# Write sanitized Newman output to `./docs/reports`.
- name: Sanitize Report Output
if: always() # Run even when postman tests fail
run: npm run report:sanitize
# Sanitized reports are needed by subsequent jobs
- uses: actions/upload-artifact@v3
if: always() # Run even when postman tests fail
with:
name: reports
path: docs/reports/
interop-credentials-revocation:
name: Revoke Credential
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: 'Mavennet'
actor: 'MAVENNET_STAGING'
- name: 'mesur.io'
actor: 'MESUR_IO_PRODUCTION'
- name: 'GS1US'
actor: 'GS1US'
- name: 'BCGov'
actor: 'BCGOV'
steps:
# Check out repo, setup node, and install dependencies.
# @see https://github.com/actions/setup-node#usage
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.15.1
cache: 'npm'
- run: npm ci
- name: Run Tests
env:
organization_did_web: ${{secrets[format('{0}_ORGANIZATION_DID_WEB', matrix.actor)]}}
client_id: ${{secrets[format('{0}_CLIENT_ID', matrix.actor)]}}
client_secret: ${{secrets[format('{0}_CLIENT_SECRET', matrix.actor)]}}
client_scope: ${{secrets[format('{0}_CLIENT_SCOPE', matrix.actor)]}}
token_audience: ${{secrets[format('{0}_TOKEN_AUDIENCE', matrix.actor)]}}
token_endpoint: ${{secrets[format('{0}_TOKEN_ENDPOINT', matrix.actor)]}}
api_base_url: ${{secrets[format('{0}_API_BASE_URL', matrix.actor)]}}
run: |
npx newman run ./docs/tutorials/credentials-status-update/credentials-status-update.postman_collection.json \
--env-var ORGANIZATION_DID_WEB=$organization_did_web \
--env-var CLIENT_ID=$client_id \
--env-var CLIENT_SECRET=$client_secret \
--env-var CLIENT_SCOPE=$client_scope \
--env-var TOKEN_AUDIENCE=$token_audience \
--env-var TOKEN_ENDPOINT=$token_endpoint \
--env-var API_BASE_URL=$api_base_url \
--reporters cli,htmlextra,json \
--reporter-htmlextra-skipSensitiveData \
--reporter-htmlextra-export "newman/${{format('{0}-{1}-{2}.html', github.run_id, github.job, matrix.name)}}" \
--reporter-json-export "newman/${{format('{0}-{1}-{2}.json', github.run_id, github.job, matrix.name)}}"
# Write sanitized Newman output to `./docs/reports`.
- name: Sanitize Report Output
if: always() # Run even when postman tests fail
run: npm run report:sanitize
# Sanitized reports are needed by subsequent jobs
- uses: actions/upload-artifact@v3
if: always() # Run even when postman tests fail
with:
name: reports
path: docs/reports/
interop-publish:
name: Publish
runs-on: ubuntu-latest
# Publishing must only happen when triggered on the 'main' branch to prevent
# tests on other branches from polluting the published reports. Note that
# `always()`` is a special flag that is REQUIRED in order to get this job to
# run if jobs listed in the `needs:` section fail.
if: github.ref == 'refs/heads/main' && always()
# All jobs for which output will be published must be complete before this
# job can run.
needs:
- interop-credentials-revocation
- interop-did-web-discovery
- interop-presentations-exchange-oauth
- traceable-presentation-workflow
steps:
# Check out repo, setup node, and install dependencies.
# @see https://github.com/actions/setup-node#usage
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.15.1
cache: 'npm'
- run: npm ci
# Download 'reports' artifact
- uses: actions/download-artifact@v3
with:
name: reports
path: docs/reports/
# Build report index
- name: Build JSON Index
run: npm run report:index -- --folder interoperability
# Set up Python 3.10
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: pip
- run: pip install -r ./reporting/requirements.txt
# Build interactive report
- name: Build Interoperability Report
working-directory: ./reporting
run: ./reporter.py --mode ci --interoperability
# Publish report subfolder to GitHub Pages
- name: Publish Interoperability Report
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/reports
destination_dir: reports/interoperability
# Prepare an archive folder name and update the index.json appropriately
- name: Prepare Interoperability Archive
id: archive
run: |
FOLDER=interoperability-$(date +'%s')
sed -i "s#reports/interoperability/#reports/$FOLDER/#" ./docs/reports/index.json
echo "::set-output name=folder::$FOLDER"
# Publish report archive subfolder to GitHub Pages
- name: Publish Interoperability Archive
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/reports
destination_dir: reports/${{ steps.archive.outputs.folder }}