From 8e8c2be9ecb104146e2fbf73c6675d8e21a6a654 Mon Sep 17 00:00:00 2001 From: Ari Perez Date: Fri, 29 Sep 2023 11:33:39 -0500 Subject: [PATCH] Vacms 15383 disable accesibility gh action (#1723) * Delete a11y.yml * Delete a11y-heading-order.yml --- .github/workflows/a11y-heading-order.yml | 268 -------------- .github/workflows/a11y.yml | 449 ----------------------- 2 files changed, 717 deletions(-) delete mode 100644 .github/workflows/a11y-heading-order.yml delete mode 100644 .github/workflows/a11y.yml diff --git a/.github/workflows/a11y-heading-order.yml b/.github/workflows/a11y-heading-order.yml deleted file mode 100644 index 265402e535..0000000000 --- a/.github/workflows/a11y-heading-order.yml +++ /dev/null @@ -1,268 +0,0 @@ -name: Accessibility Tests - Heading Order - -on: - workflow_dispatch: - schedule: - - cron: '0 7 * * 1' # 3am ET, Monday - -env: - CHROMEDRIVER_FILEPATH: /usr/local/share/chrome_driver/chromedriver - BUILD_TYPE: vagovprod - CHANNEL_ID: C01RAS1KAQK #-daily-accessibility-scan - -jobs: - build: - name: Build - runs-on: [self-hosted, asg] - timeout-minutes: 180 - defaults: - run: - working-directory: content-build - - env: - DRUPAL_ADDRESS: https://cms-content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov - NODE_EXTRA_CA_CERTS: /etc/ssl/certs/ca-certificates.crt - - steps: - - name: Checkout vagov-content - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - repository: department-of-veterans-affairs/vagov-content - path: vagov-content - - - name: Checkout content-build - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - path: content-build - - - name: Checkout vets-website - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - repository: department-of-veterans-affairs/vets-website - path: vets-website - - - name: Get Node version - id: get-node-version - run: echo NODE_VERSION=$(cat .nvmrc) >> $GITHUB_OUTPUT - - - name: Setup Node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version: ${{ steps.get-node-version.outputs.NODE_VERSION }} - - - name: Install Yarn - shell: bash - run: npm i -g yarn@1.19.1 - - - name: Install vets-website dependencies - uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3 - with: - command: cd vets-website && yarn install --frozen-lockfile --prefer-offline --network-concurrency 1 - max_attempts: 3 - timeout_minutes: 10 - - - name: Build vets-website - run: yarn build --verbose --buildtype=${{ env.BUILD_TYPE }} - working-directory: vets-website - timeout-minutes: 30 - - - name: Install content-build dependencies - uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3 - with: - command: cd content-build && yarn install --frozen-lockfile --prefer-offline --network-concurrency 1 - max_attempts: 3 - timeout_minutes: 7 - - - name: Set Drupal address - run: echo "DRUPAL_ADDRESS=https://prod.cms.va.gov" >> $GITHUB_ENV - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-gov-west-1 - - - name: set Drupal prod password - uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest - with: - ssm_parameter: /cms/prod/drupal_api_users/content_build_api/password - env_variable_name: DRUPAL_PASSWORD - - - name: set Drupal prod username - uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest - with: - ssm_parameter: /cms/prod/drupal_api_users/content_build_api/username - env_variable_name: DRUPAL_USERNAME - - - name: Build content-build - run: yarn build --buildtype=${{ env.BUILD_TYPE }} --asset-source=local --drupal-address=https://prod.cms.va.gov --drupal-user=${{ env.DRUPAL_USERNAME }} --drupal-password="${{ env.DRUPAL_PASSWORD }}" --pull-drupal --drupal-max-parallel-requests=15 --no-drupal-proxy --verbose - env: - NODE_ENV: production - - - name: Copy vets-website assets to content-build - run: | - cd .. - cp -arf vets-website/build/${{ env.BUILD_TYPE }}/* content-build/build/${{ env.BUILD_TYPE }} - - - name: Compress E2E test build - run: tar -C build/${{ env.BUILD_TYPE }} -cjf test-build.tar.bz2 . - - - name: Upload E2E test build artifact - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - with: - name: test-build.tar.bz2 - path: content-build/test-build.tar.bz2 - retention-days: 1 - - - name: Runner clean up - run: rm -rf ../content-build - - a11y: - name: Accessibility Tests - needs: build - timeout-minutes: 120 - runs-on: [self-hosted, asg] - container: - image: public.ecr.aws/cypress-io/cypress/browsers:node16.13.2-chrome100-ff98 - options: --user 1001:1001 - volumes: - - /usr/local/share:/share - - /etc/ssl/certs:/etc/ssl/certs - strategy: - fail-fast: false - max-parallel: 32 - matrix: - ci_node_index: [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] - - env: - NODE_EXTRA_CA_CERTS: /etc/ssl/certs/ca-certificates.crt - CHROMEDRIVER_FILEPATH: /share/chrome_driver/chromedriver - - steps: - - name: Checkout content-build - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - - name: Get Node version - id: get-node-version - run: echo NODE_VERSION=$(cat .nvmrc) >> $GITHUB_OUTPUT - - - name: Setup Node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version: ${{ steps.get-node-version.outputs.NODE_VERSION }} - - - name: Install dependencies - uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3 - with: - command: yarn install --frozen-lockfile --prefer-offline --production=false --network-concurrency 1 - max_attempts: 3 - timeout_minutes: 7 - env: - YARN_CACHE_FOLDER: .cache/yarn - - - name: Download production build artifact - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - with: - name: test-build.tar.bz2 - - - name: Unpack build - run: | - mkdir -p build/${{ env.BUILD_TYPE }} - tar -C build/${{ env.BUILD_TYPE }} -xjf /__w/content-build/content-build/test-build.tar.bz2 - - - name: Create a11y failures CSV file - run: touch a11y_failures.csv - - - name: Start content-build - run: node src/platform/testing/e2e/test-server.js --buildtype ${{ env.BUILD_TYPE }} --port=3002 & - - - name: Run Cypress E2E Tests - run: CYPRESS_STEP=${{ matrix.ci_node_index }} CYPRESS_CONTENT_BUILD_PORT=3002 CYPRESS_RUN_HEADINGS=true yarn cy:run --browser chrome --headless --port 3001 --config baseUrl=http://localhost:3002,video=false,specPattern=**/tests/**/*.a11y.spec.js --reporter mochawesome --reporter-options "configFile=config/cypress-reporters.json" --spec "src/platform/site-wide/tests/sitemap/sitemap.a11y.spec.js" - - - name: Rename Mochawesome JSON file - if: ${{ always() }} - run: mv mochawesome-report/mochawesome.json mochawesome-report/mochawesome-${{ matrix.ci_node_index }}.json - - - name: Rename failures CSV file - if: ${{ always() }} - run: mv a11y_failures.csv a11y_failures-${{ matrix.ci_node_index }}.csv - - - name: Archive Mochawesome test results - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - if: ${{ always() }} - with: - name: cypress-mochawesome-test-results - path: mochawesome-report - retention-days: 1 - - - name: Archive failures CSV - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - if: ${{ always() }} - with: - name: a11y_failures - path: a11y_failures-${{ matrix.ci_node_index }}.csv - retention-days: 30 - - - name: Runner clean up - run: | - rm -rf build - rm /__w/content-build/content-build/test-build.tar.bz2 - - slack: - name: Notify Slack - runs-on: ubuntu-latest - needs: [build, a11y] - if: ${{ always() && (needs.a11y.result == 'success' || needs.a11y.result == 'failure' || needs.build.result == 'success' || needs.build.result == 'failure') }} - defaults: - run: - working-directory: content-build - - steps: - - name: Checkout content-build - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - path: content-build - - - name: Download failures CSV - if: ${{ needs.a11y.result == 'failure' }} - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - with: - name: a11y_failures - path: content-build - - - name: Merge failure CSV files - if: ${{ needs.a11y.result == 'failure' }} - run: cat *csv > a11y_failures.csv - - - name: Archive merged failures CSV file - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - if: ${{ always() }} - with: - name: a11y_failures - path: content-build/a11y_failures.csv - retention-days: 30 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: 'us-gov-west-1' - - - name: Get Slack bot token - uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest - with: - ssm_parameter: /devops/github_actions_slack_bot_user_token - env_variable_name: SLACK_BOT_TOKEN - - - name: Accessibility Test Failure - uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0 - if: ${{ needs.a11y.result == 'failure' || needs.build.result == 'failure' }} - continue-on-error: true - env: - SSL_CERT_DIR: /etc/ssl/certs - SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }} - with: - payload: '{"attachments": [{"color": "#FF0800","blocks": [{"type": "section","text": {"type": "mrkdwn","text": " ATTN: Accessibility heading-order tests have failed on run: "}}]}]}' - channel-id: ${{ env.CHANNEL_ID }} diff --git a/.github/workflows/a11y.yml b/.github/workflows/a11y.yml deleted file mode 100644 index 32b7ca587d..0000000000 --- a/.github/workflows/a11y.yml +++ /dev/null @@ -1,449 +0,0 @@ -name: Accessibility Tests - -on: - workflow_dispatch: - schedule: - - cron: '0 12 * * 1-5' - -env: - CHROMEDRIVER_FILEPATH: /usr/local/share/chrome_driver/chromedriver - CHANNEL_ID: C01RAS1KAQK - -jobs: - build: - name: Build - runs-on: [self-hosted, asg] - timeout-minutes: 180 - defaults: - run: - working-directory: content-build - - env: - DRUPAL_ADDRESS: https://cms-content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov - NODE_EXTRA_CA_CERTS: /etc/ssl/certs/ca-certificates.crt - - steps: - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-gov-west-1 - - - name: Get Slack bot token - uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest - with: - ssm_parameter: /devops/github_actions_slack_bot_user_token - env_variable_name: SLACK_BOT_TOKEN - - - name: Notify Slack - if: ${{ always() }} - uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0 - continue-on-error: true - env: - SSL_CERT_DIR: /etc/ssl/certs - SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }} - with: - payload: '{"attachments": [{"color": "#BCBCBC","blocks": [{"type": "section","text": {"type": "mrkdwn","text": "Starting the daily accessibility scan of `content-build`, with run: "}}]}]}' - channel-id: ${{ env.CHANNEL_ID }} - - - name: Checkout vagov-content - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - repository: department-of-veterans-affairs/vagov-content - path: vagov-content - - - name: Checkout content-build - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - path: content-build - - - name: Checkout vets-website - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - repository: department-of-veterans-affairs/vets-website - path: vets-website - - - name: Get Node version - id: get-node-version - run: echo NODE_VERSION=$(cat .nvmrc) >> $GITHUB_OUTPUT - - - name: Setup Node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version: ${{ steps.get-node-version.outputs.NODE_VERSION }} - - - name: Install Yarn - shell: bash - run: npm i -g yarn@1.19.1 - - - name: Install vets-website dependencies - uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3 - with: - command: cd vets-website && yarn install --frozen-lockfile --prefer-offline --network-concurrency 1 - max_attempts: 3 - timeout_minutes: 10 - - - name: Build vets-website - run: yarn build --verbose --buildtype=vagovprod - working-directory: vets-website - timeout-minutes: 30 - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - timeout-minutes: 10 - with: - path: | - .cache/yarn - **/node_modules - key: ${{ steps.get-node-version.outputs.NODE_VERSION }}-on-demand-runner-cypress-${{ hashFiles('**/yarn.lock') }} - restore-keys: ${{ steps.get-node-version.outputs.NODE_VERSION }}-on-demand-runner-cypress- - - - name: Install content-build dependencies - uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3 - with: - command: cd content-build && yarn install --frozen-lockfile --prefer-offline --network-concurrency 1 - max_attempts: 3 - timeout_minutes: 7 - - - name: Set Drupal address - run: echo "DRUPAL_ADDRESS=https://prod.cms.va.gov" >> $GITHUB_ENV - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-gov-west-1 - - - name: set Drupal prod password - uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest - with: - ssm_parameter: /cms/prod/drupal_api_users/content_build_api/password - env_variable_name: DRUPAL_PASSWORD - - - name: set Drupal prod username - uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest - with: - ssm_parameter: /cms/prod/drupal_api_users/content_build_api/username - env_variable_name: DRUPAL_USERNAME - - - name: Build content-build - run: yarn build --buildtype=vagovprod --asset-source=local --drupal-address=https://prod.cms.va.gov --drupal-user=${{ env.DRUPAL_USERNAME }} --drupal-password="${{ env.DRUPAL_PASSWORD }}" --pull-drupal --drupal-max-parallel-requests=15 --no-drupal-proxy --verbose - env: - NODE_ENV: production - - - name: Copy vets-website assets to content-build - run: | - cd .. - cp -arf vets-website/build/vagovprod/* content-build/build/vagovprod - - - name: Compress E2E test build - run: tar -C build/vagovprod -cjf test-build.tar.bz2 . - - - name: Upload E2E test build artifact - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - with: - name: test-build.tar.bz2 - path: content-build/test-build.tar.bz2 - retention-days: 1 - - - name: Runner clean up - run: rm -rf ../content-build - - a11y: - name: Accessibility Tests - needs: build - timeout-minutes: 120 - runs-on: [self-hosted, asg] - container: - image: public.ecr.aws/cypress-io/cypress/browsers:node16.13.2-chrome100-ff98 - options: --user 1001:1001 --volume /usr/local/share:/share - strategy: - fail-fast: false - max-parallel: 32 - matrix: - ci_node_index: [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] - - env: - NODE_EXTRA_CA_CERTS: /share/ca-certificates/VA-Internal-S2-RCA1-v1.cer.crt - CHROMEDRIVER_FILEPATH: /share/chrome_driver/chromedriver - - steps: - - name: Checkout content-build - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - - name: Get Node version - id: get-node-version - run: echo NODE_VERSION=$(cat .nvmrc) >> $GITHUB_OUTPUT - - - name: Setup Node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version: ${{ steps.get-node-version.outputs.NODE_VERSION }} - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - timeout-minutes: 10 - with: - path: | - .cache/yarn - /github/home/.cache/Cypress - **/node_modules - key: ${{ steps.get-node-version.outputs.NODE_VERSION }}-on-demand-runner-cypress-${{ hashFiles('**/yarn.lock') }} - restore-keys: ${{ steps.get-node-version.outputs.NODE_VERSION }}-on-demand-runner-cypress- - - - name: Install dependencies - uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3 - with: - command: yarn install --frozen-lockfile --prefer-offline --production=false --network-concurrency 1 - max_attempts: 3 - timeout_minutes: 7 - env: - YARN_CACHE_FOLDER: .cache/yarn - - - name: Download production build artifact - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - with: - name: test-build.tar.bz2 - - - name: Unpack build - run: | - mkdir -p build/vagovprod - tar -C build/vagovprod -xjf /__w/content-build/content-build/test-build.tar.bz2 - - - name: Create a11y failures CSV file - run: touch a11y_failures.csv - - - name: Start content-build - run: node src/platform/testing/e2e/test-server.js --buildtype vagovprod --port=3002 & - - - name: Run Cypress E2E Tests - run: CYPRESS_STEP=${{ matrix.ci_node_index }} CYPRESS_CONTENT_BUILD_PORT=3002 yarn cy:run --browser chrome --headless --port 3001 --config baseUrl=http://localhost:3002,video=false,specPattern=**/tests/**/*.a11y.spec.js --reporter mochawesome --reporter-options "configFile=config/cypress-reporters.json" --spec "src/platform/site-wide/tests/sitemap/sitemap.a11y.spec.js" - - - name: Rename Mochawesome JSON file - if: ${{ always() }} - run: mv mochawesome-report/mochawesome.json mochawesome-report/mochawesome-${{ matrix.ci_node_index }}.json - - - name: Rename failures CSV file - if: ${{ always() }} - run: mv a11y_failures.csv a11y_failures-${{ matrix.ci_node_index }}.csv - - - name: Archive Mochawesome test results - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - if: ${{ always() }} - with: - name: cypress-mochawesome-test-results - path: mochawesome-report - retention-days: 1 - - - name: Archive failures CSV - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - if: ${{ always() }} - with: - name: a11y_failures - path: a11y_failures-${{ matrix.ci_node_index }}.csv - retention-days: 30 - - - name: Runner clean up - run: | - rm -rf build - rm /__w/content-build/content-build/test-build.tar.bz2 - - slack: - name: Notify Slack and upload Mochawesome report - runs-on: ubuntu-latest - needs: [build, a11y] - if: ${{ always() && (needs.a11y.result == 'success' || needs.a11y.result == 'failure') }} - defaults: - run: - working-directory: content-build - - steps: - - name: Checkout content-build - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - path: content-build - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: 'us-gov-west-1' - - - name: Get Slack bot token - uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest - with: - ssm_parameter: /devops/github_actions_slack_bot_user_token - env_variable_name: SLACK_BOT_TOKEN - - - name: Accessibility Test Failure - uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0 - if: ${{ needs.a11y.result == 'failure' }} - continue-on-error: true - env: - SSL_CERT_DIR: /etc/ssl/certs - SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }} - with: - payload: '{"attachments": [{"color": "#FF0800","blocks": [{"type": "section","text": {"type": "mrkdwn","text": " Daily accessibility scan has failed on run: "}}]}]}' - channel-id: ${{ env.CHANNEL_ID }} - - - name: Accessibility Test Success - uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0 - if: ${{ needs.a11y.result == 'success' }} - continue-on-error: true - env: - SSL_CERT_DIR: /etc/ssl/certs - SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }} - with: - payload: '{"attachments": [{"color": "#07711E","blocks": [{"type": "section","text": {"type": "mrkdwn","text": "Daily accessibility scan has completed successfully on run: "}}]}]}' - channel-id: ${{ env.CHANNEL_ID }} - - - name: Get Node version - id: get-node-version - run: echo NODE_VERSION=$(cat .nvmrc) >> $GITHUB_OUTPUT - - - name: Setup Node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version: ${{ steps.get-node-version.outputs.NODE_VERSION }} - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: | - .cache/yarn - **/node_modules - key: ${{ steps.get-node-version.outputs.NODE_VERSION }}-on-demand-runner-cypress-${{ hashFiles('**/yarn.lock') }} - restore-keys: ${{ steps.get-node-version.outputs.NODE_VERSION }}-on-demand-runner-cypress- - - - name: Install dependencies - uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3 - with: - command: cd content-build && yarn install --frozen-lockfile --prefer-offline --network-concurrency 1 - max_attempts: 3 - timeout_minutes: 7 - env: - YARN_CACHE_FOLDER: ~/.cache/yarn - - - name: Download failures CSV - if: ${{ needs.a11y.result == 'failure' }} - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - with: - name: a11y_failures - path: content-build - - - name: Merge failure CSV files - if: ${{ needs.a11y.result == 'failure' }} - run: cat *csv > a11y_failures.csv - - - name: Archive merged failures CSV file - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - if: ${{ always() }} - with: - name: a11y_failures - path: content-build/a11y_failures.csv - retention-days: 30 - - - name: Download Mochawesome test results - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - with: - name: cypress-mochawesome-test-results - path: content-build/cypress/results/json - - - name: Merge test results into one file - run: | - yarn run cy:report:merge && sed -i -e 's/"message": "AssertionError.*$/"message": "Accessibility violations were detected.",/g' index.json - - - name: Generate HTML report - run: yarn run cy:report:generate - - - name: Generate UUID for Mochawesome report - run: echo "UUID=$(uuidgen)" >> $GITHUB_ENV - - - name: Rename Mochawesome report file - run: | - cp -r /home/runner/work/content-build/content-build/content-build/public/index.html /home/runner/work/content-build/content-build/content-build/public/${{ env.UUID }}.html - - - name: Get AWS IAM role - uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest - with: - ssm_parameter: /frontend-team/github-actions/parameters/AWS_FRONTEND_NONPROD_ROLE - env_variable_name: AWS_FRONTEND_NONPROD_ROLE - - - name: Configure AWS Credentials (2) - uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-gov-west-1 - role-to-assume: ${{ env.AWS_FRONTEND_NONPROD_ROLE }} - role-duration-seconds: 900 - role-session-name: vsp-frontendteam-githubaction - - - name: Upload test report to s3 - run: aws s3 cp /home/runner/work/content-build/content-build/content-build/public/ s3://testing-tools-testing-reports/a11y-reports --acl public-read --region us-gov-west-1 --recursive - - - name: Accessibility Test Report Slack notification - uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0 - continue-on-error: true - env: - SSL_CERT_DIR: /etc/ssl/certs - SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }} - with: - payload: '{"attachments": [{"color": "#BCBCBC","blocks": [{"type": "section","text": {"type": "mrkdwn","text": "Daily accessibility report: "}}]}]}' - channel-id: ${{ env.CHANNEL_ID }} - - slack-failure: - name: Notify Slack - workflow failure - runs-on: ubuntu-latest - needs: [build, a11y] - if: ${{ always() && (needs.a11y.result == 'cancelled' || needs.build.result == 'failure' || needs.build.result == 'cancelled') }} - defaults: - run: - working-directory: content-build - - steps: - - name: Checkout content-build - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - path: content-build - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: 'us-gov-west-1' - - - name: Get Slack bot token - uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest - with: - ssm_parameter: /devops/github_actions_slack_bot_user_token - env_variable_name: SLACK_BOT_TOKEN - - - name: Accessibility Test Cancellation - uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0 - if: ${{ needs.a11y.result == 'cancelled' || needs.build.result == 'cancelled' }} - continue-on-error: true - env: - SSL_CERT_DIR: /etc/ssl/certs - SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }} - with: - payload: '{"attachments": [{"color": "#BCBCBC","blocks": [{"type": "section","text": {"type": "mrkdwn","text": "Daily accessibility scan has been canceled on run: "}}]}]}' - channel-id: ${{ env.CHANNEL_ID }} - - - name: Accessibility Test Build Failure - uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0 - if: ${{ needs.build.result == 'failure' }} - continue-on-error: true - env: - SSL_CERT_DIR: /etc/ssl/certs - SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }} - with: - payload: '{"attachments": [{"color": "#FF0800","blocks": [{"type": "section","text": {"type": "mrkdwn","text": " Daily accessibility scan build has failed on run: "}}]}]}' - channel-id: ${{ env.CHANNEL_ID }}