Skip to content

Commit

Permalink
Publish Accessibility test errors to Slack
Browse files Browse the repository at this point in the history
Send error runs to Slack devs notifications channel.
  • Loading branch information
scruti committed Aug 7, 2024
1 parent c301d4c commit 51a2bba
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/accessibility_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,41 @@ jobs:
- name: Report Pa11y accessibility test results
run: cat report.txt && ((`cat report.txt | grep sign-in | wc -l`<2)) || exit 1

- name: Configure AWS credentials
if: failure()
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
role-to-assume: Deployments
role-duration-seconds: 3600
role-skip-session-tagging: true

- name: Get secrets from AWS ParameterStore
if: failure()
uses: dkershner6/aws-ssm-getparameters-action@v2
with:
parameterPairs: "/teaching-vacancies/github_action/infra/slack_webhook = SLACK_WEBHOOK"

- name: Set environment variables from build output
if: failure()
run: |
echo "LINK_TO_RUN=${{ needs.build.outputs.LINK_TO_RUN}}" >> $GITHUB_ENV
- name: Notify twd_tv_dev channel on Pa11y test failures
if: failure()
uses: rtCamp/[email protected]
env:
SLACK_CHANNEL: twd_tv_dev
SLACK_USERNAME: CI Accessiblity Tests
SLACK_TITLE: Pa11y tests failures
SLACK_MESSAGE: |
Pa11y accessibility tests failed against QA environment <!channel>
See: <${{ env.LINK_TO_RUN }}|Workflow run>
SLACK_WEBHOOK: ${{env.SLACK_WEBHOOK}}
SLACK_COLOR: failure

axe:
name: Axe accessibility tests
environment: qa
Expand Down Expand Up @@ -72,6 +107,42 @@ jobs:
urls=("${urls[@]/qa\./$HTTP_BASIC_USER\:$HTTP_BASIC_PASSWORD\@qa\.}")
# Runs axe against each url from the sitemap
axe $(for url in "${urls[@]}"; do echo $url, ; done;) --exit
- name: Configure AWS credentials
if: failure()
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
role-to-assume: Deployments
role-duration-seconds: 3600
role-skip-session-tagging: true

- name: Get secrets from AWS ParameterStore
if: failure()
uses: dkershner6/aws-ssm-getparameters-action@v2
with:
parameterPairs: "/teaching-vacancies/github_action/infra/slack_webhook = SLACK_WEBHOOK"

- name: Set environment variables from build output
if: failure()
run: |
echo "LINK_TO_RUN=${{ needs.build.outputs.LINK_TO_RUN}}" >> $GITHUB_ENV
- name: Notify twd_tv_dev channel on Axe test failures
if: failure()
uses: rtCamp/[email protected]
env:
SLACK_CHANNEL: twd_tv_dev
SLACK_USERNAME: CI Accessiblity Tests
SLACK_TITLE: Axe tests failures
SLACK_MESSAGE: |
Axe accessibility tests failed against QA environment <!channel>
See: <${{ env.LINK_TO_RUN }}|Workflow run>
SLACK_WEBHOOK: ${{env.SLACK_WEBHOOK}}
SLACK_COLOR: failure

lighthouse:
name: Lighthouse tests
environment: qa
Expand Down

0 comments on commit 51a2bba

Please sign in to comment.