end-to-end-bfd tests test #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: end-to-end-bfd tests | |
| run-name: end-to-end-bfd tests ${{ inputs.environment }} | |
| on: | |
| workflow_call: | |
| inputs: | |
| environment: | |
| required: true | |
| type: string | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: AB2D environment | |
| required: true | |
| type: choice | |
| options: | |
| - dev | |
| - test | |
| - sandbox | |
| default: test | |
| concurrency: | |
| group: ${{ inputs.environment }}-e2e-test | |
| jobs: | |
| test: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| runs-on: codebuild-ab2d-${{github.run_id}}-${{github.run_attempt}} | |
| env: | |
| AB2D_BFD_KEYSTORE_LOCATION: "${{ github.workspace }}/opt/ab2d/ab2d_bfd_keystore" | |
| AB2D_V2_ENABLED: 'true' | |
| ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | |
| AWS_ACCOUNT: ${{ inputs.environment == 'sandbox' && secrets.PROD_ACCOUNT || secrets.NON_PROD_ACCOUNT }} | |
| AB2D_ENV: ${{ inputs.environment }} | |
| steps: | |
| - name: Assume AWS role | |
| uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0 | |
| with: | |
| aws-region: ${{ vars.AWS_REGION }} | |
| role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT }}:role/delegatedadmin/developer/ab2d-${{ env.AB2D_ENV }}-github-actions | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Setup Java | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Set env vars from AWS params | |
| uses: cmsgov/cdap/actions/aws-params-env-action@main | |
| env: | |
| AWS_REGION: ${{ vars.AWS_REGION }} | |
| with: | |
| params: | | |
| ARTIFACTORY_URL=/artifactory/url | |
| ARTIFACTORY_USER=/artifactory/user | |
| ARTIFACTORY_PASSWORD=/artifactory/password | |
| AB2D_BFD_KEYSTORE_PASSWORD=/ab2d/${{ env.AB2D_ENV }}/worker/sensitive/bfd_keystore_password | |
| MAIN_BUCKET=/ab2d/${{ env.AB2D_ENV }}/core/nonsensitive/main-bucket-name | |
| - name: Create opt/ab2d directory and download keystore | |
| run: | | |
| mkdir -p opt/ab2d | |
| KEYSTORE_FILE_NAME="ab2d_${{ env.AB2D_ENV }}_keystore" | |
| aws s3 cp s3://$MAIN_BUCKET/$KEYSTORE_FILE_NAME $AB2D_BFD_KEYSTORE_LOCATION | |
| test -f $AB2D_BFD_KEYSTORE_LOCATION && echo "created keystore file" | |
| - name: Run e2e-bfd-test | |
| env: | |
| AB2D_BFD_URL: 'https://prod-sbx.fhir.bfd.cmscloud.local' | |
| AB2D_BFD_URL_V3: ${{ inputs.environment == 'sandbox' && 'https://sandbox.fhirv3.bfd.cmscloud.local' || 'https://test.fhirv3.bfd.cmscloud.local'}} | |
| run: | | |
| mvn test -s settings.xml -pl e2e-bfd-test -am -Dtest=EndToEndBfdTests -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -Dusername=$ARTIFACTORY_USER -Dpassword=$ARTIFACTORY_PASSWORD -Drepository_url=$ARTIFACTORY_URL --no-transfer-progress |