-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish Accessibility test errors to Slack
Send error runs to Slack devs notifications channel.
- Loading branch information
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|