-
Notifications
You must be signed in to change notification settings - Fork 0
499 lines (487 loc) · 23.9 KB
/
deploy.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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
name: Deploy
concurrency: ci-${{ github.ref }}
on:
push:
branches:
- "*"
- "!skipci*"
permissions:
id-token: write
contents: read
actions: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Install dependencies
run: |
npm ci
for service in services/*/; do
pushd "$service"
if [ -f package-lock.json ]; then npm ci; fi
popd
done
- name: Run ESLint
run: npx eslint --max-warnings=0 services
unit-test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Unit Test & Publish Coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TEST_REPORTER_ID }}
with:
debug: true
coverageCommand: ./unit-test.sh
coverageLocations: |
${{github.workspace}}/services/*/coverage/lcov.info:lcov
deploy:
name: Deploy
needs:
- lint
- unit-test
runs-on: ubuntu-latest
steps:
- name: set branch_name
run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Check branch name is a legal serverless stage name
run: |
if [[ ! $branch_name =~ ^[a-z][a-z0-9-]*$ ]] || [[ $branch_name -gt 128 ]]; then
echo """
------------------------------------------------------------------------------------------------------------------------------
ERROR: Please read below
------------------------------------------------------------------------------------------------------------------------------
Bad branch name detected; cannot continue.
The Serverless Application Framework has a concept of stages that facilitate multiple deployments of the same service.
In this setup, the git branch name gets passed to Serverless to serve as the stage name.
The stage name (branch name in this case) is tacked onto the end of the service name by Serverless.
Therefore, the branch name must be a valid service name.
From Serverless:
A service name should only contain alphanumeric (case sensitive) and hyphens. It should start with an alphabetic character and shouldnt exceed 128 characters.
For Github Actions support, please push your code to a new branch with a name that meets Serverless' service name requirements.
So, make a new branch with a name that begins with a letter and is made up of only letters, numbers, and hyphens... then delete this branch.
------------------------------------------------------------------------------------------------------------------------------
"""
exit 1
fi
- uses: actions/checkout@v1
- name: Validate branch name
run: ./.github/branchNameValidation.sh $STAGE_PREFIX$branch_name
- name: set branch specific variable names
run: ./.github/build_vars.sh set_names
- name: set variable values
run: ./.github/build_vars.sh set_values
env:
AWS_OIDC_ROLE_TO_ASSUME: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_OIDC_ROLE_TO_ASSUME] || secrets.AWS_OIDC_ROLE_TO_ASSUME }}
AWS_DEFAULT_REGION: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_DEFAULT_REGION] || secrets.AWS_DEFAULT_REGION }}
INFRASTRUCTURE_TYPE: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_INFRASTRUCTURE_TYPE] || secrets.INFRASTRUCTURE_TYPE || 'development' }}
ROUTE_53_HOSTED_ZONE_ID: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_ROUTE_53_HOSTED_ZONE_ID] }}
ROUTE_53_DOMAIN_NAME: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_ROUTE_53_DOMAIN_NAME] }}
CLOUDFRONT_CERTIFICATE_ARN: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_CLOUDFRONT_CERTIFICATE_ARN] }}
CLOUDFRONT_DOMAIN_NAME: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_CLOUDFRONT_DOMAIN_NAME] }}
STAGE_PREFIX: ${{ secrets.STAGE_PREFIX }}
METRICS_USERS: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_METRICS_USERS] || secrets.METRICS_USERS }}
OKTA_METADATA_URL: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_OKTA_METADATA_URL] || secrets.OKTA_METADATA_URL }}
COGNITO_TEST_USERS_PASSWORD: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_COGNITO_TEST_USERS_PASSWORD] || secrets.COGNITO_TEST_USERS_PASSWORD }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Configure AWS credentials for GitHub Actions
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ env.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Combine package-lock.json files to single file
run: find services -maxdepth 3 -name package-lock.json | xargs cat package-lock.json > combined-package-lock.txt
- name: cache service dependencies
uses: actions/cache@v2
with:
path: |
services/.sechub/node_modules
services/admin/node_modules
services/seatool-sink/node_modules
services/uploads/node_modules
services/app-api/node_modules
services/one-stream/node_modules
services/stream-functions/node_modules
services/ui/node_modules
services/ui-auth/node_modules
services/ui-src/node_modules
node_modules
key: ${{ runner.os }}-${{ hashFiles('combined-package-lock.txt') }}
- name: set path
run: |
echo "PATH=$(pwd)/node_modules/.bin/:$PATH" >> $GITHUB_ENV
- name: Set dev login flag for all but production branch
if: ${{ env.branch_name != 'production' }}
run: echo "ALLOW_DEV_LOGIN=true" >> $GITHUB_ENV
- name: Set testing email address unless in prod
if: ${{ env.branch_name != 'production' }}
run: echo "[email protected]" >> $GITHUB_ENV
- name: deploy
run: |
# When deploying multiple copies of this quickstart to the same AWS Account (not ideal), a prefix helps prevent stepping on each other.
# This can optionally be set as a variable in GitHub Actions Secrets
./deploy.sh $STAGE_PREFIX$branch_name
- name: Output Endpoint
run: |
pushd services
echo "::notice::Endpoint URL - `./output.sh ui ApplicationEndpointUrl $STAGE_PREFIX$branch_name`"
popd
configure:
name: Configure
needs:
- deploy
runs-on: ubuntu-latest
steps:
- name: set branch_name
run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Check branch name is a legal serverless stage name
run: |
if [[ ! $branch_name =~ ^[a-z][a-z0-9-]*$ ]] || [[ $branch_name -gt 128 ]]; then
echo """
------------------------------------------------------------------------------------------------------------------------------
ERROR: Please read below
------------------------------------------------------------------------------------------------------------------------------
Bad branch name detected; cannot continue.
The Serverless Application Framework has a concept of stages that facilitate multiple deployments of the same service.
In this setup, the git branch name gets passed to Serverless to serve as the stage name.
The stage name (branch name in this case) is tacked onto the end of the service name by Serverless.
Therefore, the branch name must be a valid service name.
From Serverless:
A service name should only contain alphanumeric (case sensitive) and hyphens. It should start with an alphabetic character and shouldnt exceed 128 characters.
For Github Actions support, please push your code to a new branch with a name that meets Serverless' service name requirements.
So, make a new branch with a name that begins with a letter and is made up of only letters, numbers, and hyphens... then delete this branch.
------------------------------------------------------------------------------------------------------------------------------
"""
exit 1
fi
- uses: actions/checkout@v1
- name: Validate branch name
run: ./.github/branchNameValidation.sh $STAGE_PREFIX$branch_name
- name: set branch specific variable names
run: ./.github/build_vars.sh set_names
- name: set variable values
run: ./.github/build_vars.sh set_values
env:
AWS_OIDC_ROLE_TO_ASSUME: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_OIDC_ROLE_TO_ASSUME] || secrets.AWS_OIDC_ROLE_TO_ASSUME }}
AWS_DEFAULT_REGION: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_DEFAULT_REGION] || secrets.AWS_DEFAULT_REGION }}
INFRASTRUCTURE_TYPE: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_INFRASTRUCTURE_TYPE] || secrets.INFRASTRUCTURE_TYPE || 'development' }}
ROUTE_53_HOSTED_ZONE_ID: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_ROUTE_53_HOSTED_ZONE_ID] }}
ROUTE_53_DOMAIN_NAME: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_ROUTE_53_DOMAIN_NAME] }}
CLOUDFRONT_CERTIFICATE_ARN: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_CLOUDFRONT_CERTIFICATE_ARN] }}
CLOUDFRONT_DOMAIN_NAME: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_CLOUDFRONT_DOMAIN_NAME] }}
STAGE_PREFIX: ${{ secrets.STAGE_PREFIX }}
METRICS_USERS: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_METRICS_USERS] || secrets.METRICS_USERS }}
OKTA_METADATA_URL: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_OKTA_METADATA_URL] || secrets.OKTA_METADATA_URL }}
COGNITO_TEST_USERS_PASSWORD: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_COGNITO_TEST_USERS_PASSWORD] || secrets.COGNITO_TEST_USERS_PASSWORD }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Configure AWS credentials for GitHub Actions
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ env.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Combine package-lock.json files to single file
run: find services -maxdepth 3 -name package-lock.json | xargs cat package-lock.json > combined-package-lock.txt
- name: cache service dependencies
uses: actions/cache@v2
with:
path: |
services/.sechub/node_modules
services/admin/node_modules
services/seatool-sink/node_modules
services/uploads/node_modules
services/app-api/node_modules
services/one-stream/node_modules
services/stream-functions/node_modules
services/ui/node_modules
services/ui-auth/node_modules
services/ui-src/node_modules
node_modules
key: ${{ runner.os }}-${{ hashFiles('combined-package-lock.txt') }}
- name: set path
run: |
echo "PATH=$(pwd)/node_modules/.bin/:$PATH" >> $GITHUB_ENV
- name: Set dev login flag for all but production branch
if: ${{ env.branch_name != 'production' }}
run: echo "ALLOW_DEV_LOGIN=true" >> $GITHUB_ENV
- name: Set testing email address unless in prod
if: ${{ env.branch_name != 'production' }}
run: echo "[email protected]" >> $GITHUB_ENV
- name: Output Endpoint
run: |
pushd services
echo "::notice::Endpoint URL - `./output.sh ui ApplicationEndpointUrl $STAGE_PREFIX$branch_name`"
popd
- name: Seed Data
# this "resets" any data explicitly provided in the seed files to what
# is in the committed code
if: ${{ env.branch_name != 'production' && env.branch_name != 'master' }}
env:
SLS_DEBUG: 'true'
BRANCH: ${{ env.STAGE_PREFIX }}${{ env.branch_name }}
run: cd services/app-api && serverless dynamodb seed --stage=$BRANCH --region=$AWS_DEFAULT_REGION --online
- name: Load Test Users
if: ${{ env.branch_name != 'production'}}
run: ./loadTestUsers.py $STAGE_PREFIX$branch_name
- name: Migrate Data
if: ${{ env.branch_name != 'production'}}
run: cd ./services/app-api && sls invoke -s $STAGE_PREFIX$branch_name -f migrate
- name: Reset Test Data
if: ${{ env.branch_name != 'production'}}
run: cd ./services/admin && sls invoke -s $STAGE_PREFIX$branch_name -f resetData
cypress-test:
name: Cypress Tests
needs: configure
if: ${{ github.ref != 'refs/heads/production'}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
containers:
[
Package_Details_Appendix_K_CMS_User.spec.feature,
Package_Details_Appendix_K_State_User.spec.feature,
Package_Details_CHIP_SPA_CMS_User.spec.feature,
Package_Details_CHIP_SPA_State_User.spec.feature,
Package_Details_Initial_Waiver_CMS_User.spec.feature,
Package_Details_Initial_Waiver_State_User.spec.feature,
Package_Details_Medicaid_SPA_CMS_User.spec.feature,
Package_Details_Medicaid_SPA_State_User.spec.feature,
Package_Details_Renewal_Waiver_CMS_User.spec.feature,
Package_Details_Renewal_Waiver_State_User.spec.feature,
Package_Details_Temporary_Extension_CMS_User.spec.feature,
Package_Details_Temporary_Extension_State_User.spec.feature,
Package_Details_Waiver_Amendment_CMS_User.spec.feature,
Package_Details_Waiver_Amendment_State_User.spec.feature,
Dashboard_Initial_Waiver_RAI_Response.spec.feature,
Dashboard_Column_Picker_SPA_CMS.spec.feature,
Dashboard_Column_Picker_SPA_State.spec.feature,
Dashboard_Column_Picker_Waiver_CMS.spec.feature,
Dashboard_Column_Picker_Waiver_State.spec.feature,
Dashboard_Filter_By_State.spec.feature,
Dashboard_Filter_options_that_include_Dates.spec.feature,
Dashboard_Filter_options_that_include_Dates_CMS.spec.feature,
Dashboard_Filter.spec.feature,
Dashboard_Search_Bar.spec.feature,
Dashboard_Medicaid_SPA_RAI_Response.spec.feature,
Dashboard_Waiver_Renewal_RAI_Response.spec.feature,
SPA_Form_Logic.spec.feature,
Dashboard_Tabs.spec.feature,
Dashboard_Waiver_Amendment_RAI_Response.spec.feature,
Comprehensive_Capitated_1915b_Waiver_Form_Logic.spec.feature,
FFS_Selective_Waiver_Form_Logic.spec.feature,
Profile_View_CMS_Approver.spec.feature,
Profile_View_CMS_System_Admin.spec.feature,
Profile_View_CMS_User_Denied.spec.feature,
Profile_View_CMS_User_Revoked.spec.feature,
Profile_View_Helpdesk_User.spec.feature,
Profile_View_Mixed_Case_Emails.spec.feature,
Profile_View_State_Submitter.spec.feature,
Profile_View_State_System_Admin.spec.feature,
Request_A_Role_Change_As_CMS_Read_Only.spec.feature,
Request_A_Role_Change.spec.feature,
Home_Page.spec.feature,
FAQ_Page.spec.feature,
Chip_SPA_Form.spec.feature,
Medicaid_SPA_Form.spec.feature,
CMS_Read_Only_View.spec.feature,
Appendix_K_Form.spec.feature,
FFS_Selective_Waiver_Amendment_Form.spec.feature,
FFS_Selective_Waiver_Renewal_Form.spec.feature,
FFS_Selective_Initial_Waiver_Form.spec.feature,
Comprehensive_Capitated_1915b_Initial_Waiver_Form.spec.feature,
Comprehensive_Capitated_1915b_Waiver_Amendment_Form.spec.feature,
Comprehensive_Capitated_1915b_Waiver_Renewal_Form.spec.feature,
Dashboard_CHIP_SPA_RAI_Response.spec.feature,
Dashboard_AppK_RAI_Response.spec.feature,
Temporary_Extension_1915b_Form.spec.feature,
Temporary_Extension_1915c_Form.spec.feature,
Dashboard_No_Action_Packages.spec.feature,
Dashboard_RAI_Issued_Actions.spec.feature,
Dashboard_Under_Review_Actions.spec.feature,
Dashboard_Approved_Actions.spec.feature,
Dashboard_Filter_CMS.spec.feature,
Withdraw_Package_Form_App_K_Amendment.spec.feature,
Withdraw_Package_Form_CHIP_SPA.spec.feature,
Withdraw_Package_Form_Initial_Waiver.spec.feature,
Withdraw_Package_Form_Medicaid_SPA.spec.feature,
Withdraw_Package_Form_Waiver_Amendment.spec.feature,
Withdraw_Package_Form_Waiver_Renewal.spec.feature,
]
steps:
- name: set branch_name
run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- uses: actions/checkout@v1
- name: set branch specific variable names
run: ./.github/build_vars.sh set_names
- name: set variable values
run: ./.github/build_vars.sh set_values
env:
AWS_OIDC_ROLE_TO_ASSUME: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_OIDC_ROLE_TO_ASSUME] || secrets.AWS_OIDC_ROLE_TO_ASSUME }}
AWS_DEFAULT_REGION: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_DEFAULT_REGION] || secrets.AWS_DEFAULT_REGION }}
INFRASTRUCTURE_TYPE: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_INFRASTRUCTURE_TYPE] || secrets.INFRASTRUCTURE_TYPE || 'development' }}
STAGE_PREFIX: ${{ secrets.STAGE_PREFIX }}
COGNITO_TEST_USERS_PASSWORD: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_COGNITO_TEST_USERS_PASSWORD] || secrets.COGNITO_TEST_USERS_PASSWORD }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Configure AWS credentials for GitHub Actions
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ env.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Combine package-lock.json files to single file
run: find services -maxdepth 3 -name package-lock.json | xargs cat package-lock.json > combined-package-lock.txt
- name: cache service dependencies
uses: actions/cache@v3
with:
path: |
services/uploads/node_modules
services/app-api/node_modules
services/stream-functions/node_modules
services/ui/node_modules
services/ui-auth/node_modules
services/ui-src/node_modules
node_modules
key: ${{ runner.os }}-${{ hashFiles('combined-package-lock.txt') }}
- name: Install dependencies
run: |
npm i --legacy-peer-deps
- name: set path
run: |
echo "PATH=$(pwd)/node_modules/.bin/:$PATH" >> $GITHUB_ENV
- name: Endpoint
run: |
pushd services
export APPLICATION_ENDPOINT=`./output.sh ui ApplicationEndpointUrl $STAGE_PREFIX$branch_name`
echo "APPLICATION_ENDPOINT=$APPLICATION_ENDPOINT" >> $GITHUB_ENV
echo "Application endpoint: $APPLICATION_ENDPOINT"
popd
- name: Run Cypress Tests
uses: cypress-io/github-action@v5
with:
working-directory: tests/cypress
spec: cypress/e2e/${{ matrix.containers }}
browser: chrome
config: baseUrl=${{ env.APPLICATION_ENDPOINT }}
- name: Upload screenshots
uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-screenshots
path: tests/cypress/screenshots/
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
if: env.SLACK_WEBHOOK_URL != '' && contains(fromJson('["develop", "master", "production"]'), env.branch_name) && failure ()
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_USERNAME: ${{env.branch_name}} Deploy Failure
SLACK_ICON_EMOJI: ":bell:"
SLACK_COLOR: ${{job.status}}
SLACK_FOOTER: ""
MSG_MINIMAL: actions url,commit,ref
a11y-tests:
name: A11y Tests
needs: configure
if: ${{ github.ref != 'refs/heads/production' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
containers:
[
homePage,
faqPage,
manageProfilePage,
dashboardPage,
packagePageSpas,
packagePageWaivers,
RequestRoleChangePage,
spaTypePage,
submissionType,
PackageWaiverActionTypePage,
PackageSubmissionType,
PackageSpaTypePage,
PackageRequestTempExtentionPage,
PackageMedicaidSpaPage,
PackageCHIPSPAPage,
PackageAppendixKPage,
PackageWaiverAmendmentPage,
PackageInitialWaiverPage,
PackageWaiverRenewalPage,
]
steps:
- name: set branch_name
run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- uses: actions/checkout@v1
- name: set branch specific variable names
run: ./.github/build_vars.sh set_names
- name: set variable values
run: ./.github/build_vars.sh set_values
env:
AWS_OIDC_ROLE_TO_ASSUME: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_OIDC_ROLE_TO_ASSUME] || secrets.AWS_OIDC_ROLE_TO_ASSUME }}
AWS_DEFAULT_REGION: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_DEFAULT_REGION] || secrets.AWS_DEFAULT_REGION }}
INFRASTRUCTURE_TYPE: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_INFRASTRUCTURE_TYPE] || secrets.INFRASTRUCTURE_TYPE || 'development' }}
STAGE_PREFIX: ${{ secrets.STAGE_PREFIX }}
COGNITO_TEST_USERS_PASSWORD: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_COGNITO_TEST_USERS_PASSWORD] || secrets.COGNITO_TEST_USERS_PASSWORD }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Configure AWS credentials for GitHub Actions
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ env.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Combine package-lock.json files to single file
run: find services -maxdepth 3 -name package-lock.json | xargs cat package-lock.json > combined-package-lock.txt
- name: cache service dependencies
uses: actions/cache@v3
with:
path: |
services/app-api/node_modules
services/uploads/node_modules
services/stream-functions/node_modules
services/ui/node_modules
services/ui-auth/node_modules
services/ui-src/node_modules
node_modules
key: ${{ runner.os }}-${{ hashFiles('combined-package-lock.txt') }}
- name: Install dependencies
run: |
npm install --frozen-lockfile --legacy-peer-deps
- name: set path
run: |
echo "PATH=$(pwd)/node_modules/.bin/:$PATH" >> $GITHUB_ENV
- name: Endpoint
run: |
pushd services
export APPLICATION_ENDPOINT=`./output.sh ui ApplicationEndpointUrl $STAGE_PREFIX$branch_name`
echo "APPLICATION_ENDPOINT=$APPLICATION_ENDPOINT" >> $GITHUB_ENV
echo "Application endpoint: $APPLICATION_ENDPOINT"
popd
- name: Check Project A11y
uses: cypress-io/github-action@v5
with:
working-directory: tests/cypress
spec: cypress/e2e/a11y/${{ matrix.containers }}.spec.js
browser: chrome
config: baseUrl=${{ env.APPLICATION_ENDPOINT }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}