missing region #46
Workflow file for this run
This file contains 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: Cypress Integration Test Workflow | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
commit_sha: | ||
description: 'Commit sha: from your branch' | ||
required: true | ||
product: | ||
description: 'App: Your target product directory within src/applications' | ||
required: true | ||
# TO-DO: create a solution that maintains an updated list of active products within src/applications | ||
env: | ||
BUILDTYPE: vagovprod | ||
VETS_WEBSITE_CHANNEL_ID: '' | ||
jobs: | ||
check-for-existing-build: | ||
name: Check s3 for archived build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017 | ||
with: | ||
fetch-depth: 0 | ||
- name: Configure AWS credentials (1) | ||
if: steps.check-deployability.outputs.is_deployable == 'true' | ||
uses: ./.github/workflows/configure-aws-credentials | ||
with: | ||
aws_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws_region: us-gov-west-1 | ||
- name: Get AWS IAM role | ||
uses: ./.github/workflows/inject-secrets | ||
with: | ||
ssm_parameter: /frontend-team/github-actions/parameters/AWS_FRONTEND_PROD_ROLE | ||
env_variable_name: AWS_FRONTEND_PROD_ROLE | ||
- name: Get AWS IAM role | ||
uses: ./.github/workflows/inject-secrets | ||
with: | ||
ssm_parameter: /frontend-team/github-actions/parameters/AWS_FRONTEND_PROD_ROLE | ||
env_variable_name: AWS_FRONTEND_PROD_ROLE | ||
- name: Configure AWS Credentials (2) | ||
uses: ./.github/workflows/configure-aws-credentials | ||
with: | ||
aws_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws_region: us-gov-west-1 | ||
role: ${{ env.AWS_FRONTEND_NONPROD_ROLE != '' && env.AWS_FRONTEND_NONPROD_ROLE || env.AWS_FRONTEND_PROD_ROLE }} | ||
role_duration: 1200 | ||
session_name: vsp-frontendteam-githubaction | ||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
with: | ||
mask-password: false | ||
- name: Get va-vsp-bot token | ||
uses: ./.github/workflows/inject-secrets | ||
with: | ||
ssm_parameter: /devops/VA_VSP_BOT_GITHUB_TOKEN | ||
env_variable_name: VA_VSP_BOT_GITHUB_TOKEN | ||
- name: Find the build | ||
id: find-build | ||
run: | | ||
ARCHIVE_NAME=Z${{ github.event.inputs.commit_sha }}/vagovprod.tar.bz2 | ||
BUCKET_PATH=s3://vetsgov-website-builds-s3-upload/artifacts/ | ||
TARGET_DIR=build/${{ env.BUILDTYPE }} | ||
aws s3 cp $BUCKET_PATH$ARCHIVE_NAME . | ||
if [ -f $ARCHIVE_NAME ]; then | ||
mkdir -p $TARGET_DIR | ||
tar -xvjf $ARCHIVE_NAME -C /vets-website | ||
echo "BUILD_EXISTS=true" >> $GITHUB_ENV | ||
else | ||
echo "Requested build not found. Workflow cannot run." | ||
exit 1 | ||
integration-test: | ||
name: Set up variables and then run the integration tests. | ||
runs-on: ubuntu-latest | ||
needs: check-for-existing-build | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.inputs.commit_sha }} | ||
- name: Configure AWS Credentials | ||
uses: ./.github/workflows/configure-aws-credentials | ||
with: | ||
aws_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws_region: us-gov-west-1 | ||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
with: | ||
mask-password: false | ||
- name: Get va-vsp-bot token | ||
uses: ./.github/workflows/inject-secrets | ||
with: | ||
ssm_parameter: /devops/VA_VSP_BOT_GITHUB_TOKEN | ||
env_variable_name: VA_VSP_BOT_GITHUB_TOKEN | ||
- name: Run integration helper script | ||
id: helper | ||
run: | | ||
chmod +x ./script/github-actions/cypress-integration-test.sh | ||
./script/github-actions/cypress-integration-test.sh "${{ github.event.inputs.product }}" | ||
- name: Call reusable action | ||
id: cypress-action | ||
uses: department-of-veterans-affairs/vsp-github-actions/cypress-integration-test/action.yaml@fc22f03d949bb0fde51f0708b2df3fffedaa7dfd |