Skip to content

fix route

fix route #4858

Workflow file for this run

name: Deploy
on:
push:
branches:
- "*"
- "!skipci*"
concurrency:
group: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}-group
env:
STAGE_NAME: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
permissions:
id-token: write
contents: write
issues: write
pull-requests: write
jobs:
init:
runs-on: ubuntu-20.04
steps:
- name: Validate stage name
run: |
if [[ ! $STAGE_NAME =~ ^[a-z][a-z0-9-]*$ ]]; then
echo "ERROR: Your branch name, $STAGE_NAME, is not a valid Serverless Framework stage name." && exit 1
fi
cache:
runs-on: ubuntu-20.04
needs:
- init
environment:
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: run install
deploy:
runs-on: ubuntu-20.04
needs:
- cache
environment:
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
url: ${{ steps.deployment-data.outputs.APPURL }}
outputs:
app-url: ${{ steps.deployment-data.outputs.APPURL }}
kibana-url: ${{ steps.kibana-url.outputs.KIBANAURL }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/setup
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: us-east-1
role-duration-seconds: 10800
- name: Deploy
run: run deploy --stage $STAGE_NAME
- name: Set Site URL
id: deployment-data
run: |
echo ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
echo "APPURL=$(
aws cloudformation \
--region us-east-1 describe-stacks \
--stack-name $PROJECT-ui-infra-$STAGE_NAME \
--query Stacks[0].Outputs[0].OutputValue
)" | tr -d \'\" >> $GITHUB_OUTPUT
- name: Set Kibana URL
id: kibana-url
run: |
echo KIBANAURL=$(
sls info --verbose --stage $STAGE_NAME |& grep -m 1 OpenSearchDashboardEndpoint |
awk '{print $NF}' | awk '{$1=$1};1' |
tr -d \'\"
) >> $GITHUB_OUTPUT
kibana-url:
runs-on: ubuntu-20.04
needs:
- deploy
environment:
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}-kibana
url: ${{ needs.deploy.outputs.kibana-url }}
steps:
- name: Display Kibana URL
run: |
echo "Kibana URL: ${{ needs.deploy.outputs.kibana-url }}"
test:
runs-on: ubuntu-20.04
needs:
- cache
environment:
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/setup
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: us-east-1
role-duration-seconds: 10800
- name: Test
run: yarn test-ci
e2e:
timeout-minutes: 5
runs-on: ubuntu-20.04
needs:
- deploy
environment:
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
env:
baseurl: ${{ needs.deploy.outputs.app-url }}
if: ${{ github.ref != 'refs/heads/production' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: us-east-1
role-duration-seconds: 10800
- name: Run e2e tests
run: run e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: src/services/ui/playwright-report/
retention-days: 30
cfn-nag:
runs-on: ubuntu-20.04
needs:
- deploy
environment:
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/setup
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: us-east-1
role-duration-seconds: 10800
- name: Get CloudFormation templates
id: getCfts
run: |
mkdir -p cftemplates
stackList=(`aws cloudformation describe-stacks --query "Stacks[?Tags[?Key=='STAGE' && Value=='$STAGE_NAME'] && Tags[?Key=='PROJECT' && Value=='$PROJECT']].StackName" --output text`)
for stack in "${stackList[@]}"; do
aws cloudformation get-template --stack-name "$stack" --query TemplateBody > "cftemplates/${stack}.json"
done
- name: Stelligent cfn_nag
uses: stelligent/[email protected]
with:
input_path: cftemplates
resources:
runs-on: ubuntu-20.04
needs:
- deploy
environment:
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/setup
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: us-east-1
role-duration-seconds: 10800
- name: Get AWS Stage Resources
id: stage-resources
run: |
mkdir -p resources
resourceData=()
stackList=(`aws cloudformation describe-stacks --query "Stacks[?Tags[?Key=='STAGE' && Value=='$STAGE_NAME'] && Tags[?Key=='PROJECT' && Value=='$PROJECT']].StackName" --output text`)
for stack in "${stackList[@]}"; do
resources=$(aws cloudformation list-stack-resources --stack-name "$stack" --query "StackResourceSummaries[].{PhysicalResourceId:PhysicalResourceId, ResourceType:ResourceType, ResourceStatus:ResourceStatus, LogicalResourceId:LogicalResourceId, LastUpdatedTimestamp:LastUpdatedTimestamp}" --output json)
resourceData+=( $(echo "$resources" | jq -c --arg stack_name "$stack" '.[] + { StackName: $stack_name }') )
done
join_by() { local IFS="$1"; shift; echo "$*"; }
echo "["$(join_by "," "${resourceData[@]}")"]" > "resources/aws-resources.json"
- name: Archive stage resources
uses: actions/upload-artifact@v3
with:
name: aws-resources-${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
path: resources/aws-resources.json
cypress-e2e:
name: Cypress E2E Tests
needs: deploy
if: ${{ github.ref != 'refs/heads/production'}}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
containers:
[
CMS_Read_Only_View.spec.feature,
Chip_SPA_Form.spec.feature,
Dashboard_CHIP_SPA_RAI_Response.spec.feature,
Dashboard_Filter.spec.feature,
Dashboard_Filter_By_State.spec.feature,
Dashboard_Filter_CMS.spec.feature,
Dashboard_Filter_options_that_include_Dates.spec.feature,
Dashboard_Filter_options_that_include_Dates_CMS.spec.feature,
Dashboard_Medicaid_SPA_RAI_Response.spec.feature,
Dashboard_No_Action_Packages.spec.feature,
Dashboard_RAI_Issued_Actions.spec.feature,
Dashboard_Search_Bar.spec.feature,
Dashboard_Tabs.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_Under_Review_Actions.spec.feature,
FAQ_Page.spec.feature,
Home_Page.spec.feature,
Medicaid_SPA_Form.spec.feature,
Package_Details_2nd_Clock.spec.feature,
Package_Details_Admin_Package_Changes.spec.feature,
Package_Details_CHIP_SPA_CMS_User.spec.feature,
Package_Details_CHIP_SPA_State_User.spec.feature,
Package_Details_Medicaid_SPA_CMS_User.spec.feature,
Package_Details_Medicaid_SPA_State_User.spec.feature,
Profile_View_CMS_System_Admin.spec.feature,
Profile_View_Helpdesk_User.spec.feature,
SPA_Form_Logic.spec.feature,
Comprehensive_Capitated_1915b_Initial_Waiver_Form.spec.feature,
Comprehensive_Capitated_1915b_Waiver_Amendment_Form.spec.feature,
Comprehensive_Capitated_1915b_Waiver_Form_Logic.spec.feature,
Comprehensive_Capitated_1915b_Waiver_Renewal_Form.spec.feature,
Dashboard_Approved_Actions.spec.feature,
Dashboard_Comprehensive_Initial_Waiver_RAI_Response.spec.feature,
Dashboard_FFS_Initial_Waiver_RAI_Response.spec.feature,
Dashboard_Waiver_Amendment_RAI_Response.spec.feature,
Dashboard_Waiver_Renewal_RAI_Response.spec.feature,
FFS_Selective_Initial_Waiver_Form.spec.feature,
FFS_Selective_Waiver_Amendment_Form.spec.feature,
FFS_Selective_Waiver_Form_Logic.spec.feature,
FFS_Selective_Waiver_Renewal_Form.spec.feature,
Package_Details_Waiver_Amendment_State_User.spec.feature,
Package_Details_Waiver_Amendment_CMS_User.spec.feature,
Package_Details_Renewal_Waiver_State_User.spec.feature,
Package_Details_Renewal_Waiver_CMS_User.spec.feature,
Package_Details_Initial_Waiver_State_User.spec.feature,
Package_Details_Initial_Waiver_CMS_User.spec.feature,
Temporary_Extension_1915b_Form.spec.feature,
Temporary_Extension_1915c_Form.spec.feature,
Withdraw_Package_Form_Initial_Waiver.spec.feature,
Withdraw_Package_Form_Waiver_Amendment.spec.feature,
Withdraw_Package_Form_Waiver_Renewal.spec.feature,
Withdraw_Package_Form_Medicaid_SPA.spec.feature,
Withdraw_Package_Form_CHIP_SPA.spec.feature
]
steps:
- name: set branch_name
run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: us-east-1
- name: Checkout
uses: actions/checkout@v4
- name: Run Cypress Tests
uses: cypress-io/github-action@v6
with:
install-command: yarn install --modules-folder node_modules/
working-directory: src/services/cypress
spec: cypress/e2e/${{ matrix.containers }}
browser: chrome
config: baseUrl=${{ steps.deployment-data.outputs.APPURL }}
env: cognito_url=$(echo $(serverless param get --name CognitoUserPoolClientDomain)
- name: Upload screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: src/services/cypress/screenshots/
a11y-tests:
name: A11y Tests
needs: deploy
if: ${{ github.ref != 'refs/heads/production' }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
containers:
[
1915b4ffsSelectingContractingWaivers.spec.js,
1915b4ffsSelectiveContractingNewInitialWaiverPage.spec.js,
1915b4ffsSelectiveContractingRenewalWaiver.spec.js,
1915b4ffsSelectiveContractingWaiverAmendment.spec.js,
1915bComprehensiveCapitatedNewInitialWaiver.spec.js,
1915bComprehensiveCapitatedRenewalWaiver.spec.js,
1915bComprehensiveCapitatedwaiverAmendment.spec.js,
1915bComprehensiveCapitatedWaiverAuthority.spec.js,
1915bWaiverActions.spec.js,
1915cAppendixKAmmendment.spec.js,
allOtherChipSpaSubmissions.spec.js,
allOtherMedicaidSpasSubmissions.spec.js,
chipEligibality.spec.js,
chipSpaPage.spec.js,
dashboardFirstEntry.spec.js,
dashboardPage.spec.js,
dashboardWaiversPage.spec.js,
dashoboardNewsubmission.spec.js,
faqPage.spec.js,
homePage.spec.js,
MedicaidAlternateBenefitsPlanABPAndMedicaidPremiumsAndCostSharingPage.spec.js,
medicaidSPA.spec.js,
requestTemporaryExtension.spec.js,
statePlanAmendmentSPA.spec.js,
viewProfilePage.spec.js,
waiverActions.spec.js,
webformsPage.spec.js
]
steps:
- name: set branch_name
run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: us-east-1
- name: Checkout
uses: actions/checkout@v4
- name: Check Project A11y
uses: cypress-io/github-action@v6
with:
install-command: yarn install --modules-folder node_modules/
working-directory: src/services/cypress
spec: src/services/cypress/cypress/a11y/${{ matrix.containers }}
browser: chrome
config: baseUrl=${{ steps.deployment-data.outputs.APPURL }}
env: cognito_url=$(echo $(serverless param get --name CognitoUserPoolClientDomain)
release:
runs-on: ubuntu-20.04
needs:
- test
- cfn-nag
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/setup
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
notify_of_failure:
runs-on: ubuntu-20.04
needs:
- release
if: failure()
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
if: env.SLACK_WEBHOOK != '' && contains(fromJson('["master", "val", "production"]'), env.STAGE_NAME)
env:
SLACK_COLOR: ${{job.status}}
SLACK_ICON: https://github.com/Enterprise-CMCS.png?size=48
SLACK_TITLE: Failure
SLACK_USERNAME: ${{ github.repository }} - ${{job.status}}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}