-
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.
Add lighthouse output reports to slack message
- Loading branch information
Showing
1 changed file
with
26 additions
and
4 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 |
---|---|---|
|
@@ -93,7 +93,7 @@ jobs: | |
skip-ruby: true | ||
|
||
- name: Install axe-core and sitemap-urls | ||
run: npm install -g @axe-core/cli sitemap-urls | ||
run: npm install -g @axe-core/cli sitemap-urls node-jq | ||
|
||
- name: Get list of URLs to test against from QA sitemap | ||
run: | | ||
|
@@ -167,14 +167,36 @@ jobs: | |
run: | | ||
encoded_auth=$(echo -n $HTTP_BASIC_USER:$HTTP_BASIC_PASSWORD | base64) | ||
sed -i "s/auth_token/${encoded_auth}/g" .lighthouserc.json | ||
- name: Set environment variables for testing URLs | ||
run: | | ||
echo "INDEX_URL=https://qa.teaching-vacancies.service.gov.uk" >> $INDEX_URL | ||
echo "JOBS_URL=$INDEX_URL/jobs" >> $JOBS_URL | ||
echo "SCHOOLS_URL=$INDEX_URL/schools" >> $SCHOOLS_URL | ||
- name: Audit URLs using Lighthouse | ||
uses: treosh/lighthouse-ci-action@v12 | ||
with: | ||
urls: | | ||
https://qa.teaching-vacancies.service.gov.uk | ||
https://qa.teaching-vacancies.service.gov.uk/jobs | ||
https://qa.teaching-vacancies.service.gov.uk/schools | ||
$INDEX_URL | ||
$JOBS_URL | ||
$SCHOOLS_URL | ||
uploadArtifacts: true # save results as an action artifacts | ||
temporaryPublicStorage: true # upload lighthouse report to the temporary storage | ||
runs: 3 | ||
|
||
- name: Set environment variables for test results | ||
run: | | ||
echo "INDEX_RESULTS=$(${{steps.LHCIAction.outputs.links}} | jq '.["$INDEX_URL"]')" >> $INDEX_RESULTS | ||
- name: Notify twd_tv_dev channel on Lighthouse results | ||
uses: rtCamp/[email protected] | ||
env: | ||
SLACK_CHANNEL: twd_tv_dev | ||
SLACK_USERNAME: CI Accessiblity Tests | ||
SLACK_TITLE: LightHouse tests results | ||
SLACK_MESSAGE: | | ||
LightHouse accessibility and performance tests ran against the QA environment <!channel> | ||
<Results for $INDEX_URL|$INDEX_RESULTS> | ||
SLACK_WEBHOOK: ${{env.SLACK_WEBHOOK}} | ||
SLACK_COLOR: good |