Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Nightly full pa11y scan #3834

Closed
wants to merge 44 commits into from
Closed
Changes from 15 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
7e35304
CircleCI scheduled workflow config test
caleywoods May 16, 2024
9261d8b
Fix cron formatting
caleywoods May 16, 2024
4a68972
Test if the workflow name is important
caleywoods May 16, 2024
3fccc74
Change branch name, workflow name not important it just needs to be u…
caleywoods May 16, 2024
f333e0b
Fix branch name in the config
caleywoods May 16, 2024
f7b9783
Fix pa11y scan job step
caleywoods May 16, 2024
64c2251
Add conditional steps so we can just have one job
caleywoods May 16, 2024
3e6bcc5
Fix circleci config nesting
caleywoods May 16, 2024
d5708c5
Remove conditions on the Jekyll build
caleywoods May 16, 2024
cac97a3
Tweak the config file
caleywoods May 16, 2024
a3091fb
Fix shell if statement syntax
caleywoods May 16, 2024
a5526b0
Correct the string comparison condition
caleywoods May 16, 2024
0c0d74f
Output circleci pipeline trigger source for debugging
caleywoods May 16, 2024
c528632
Fix condition
caleywoods May 16, 2024
378417b
Remove debug step and update to the correct schedule
caleywoods May 16, 2024
c1d5057
Fix conditional PA11Y_TARGETS env var checking
caleywoods May 22, 2024
f5fc9e5
Change nightly scan time for testing
caleywoods May 22, 2024
9623d8b
Remove exit code 1; no reason to fail the build
caleywoods May 22, 2024
732c77b
Better conditional logic for pa11y scanning
caleywoods May 22, 2024
539ae00
Fix bad whitespace formatting
caleywoods May 22, 2024
851c3e8
Change how we handle file change detection for pa11y
caleywoods May 22, 2024
f78d29c
Set pa11y scan back to once a day
caleywoods May 22, 2024
25c4455
Testing env secret
caleywoods May 22, 2024
a4df964
Remove secrets env var test
caleywoods May 22, 2024
d1bbfff
Testing GitHub webhook call
caleywoods Jun 13, 2024
49a5b0f
Fix config syntax error
caleywoods Jun 13, 2024
c4d1a63
Add wrap0 for base64
caleywoods Jun 13, 2024
ddc74be
Move checkout instruction to try and fix build error
caleywoods Jun 13, 2024
09ff4ac
Test nightly scan now that build error is fixed
caleywoods Jun 13, 2024
cb68065
Temporarily remove script to see if a normal scan with errors causes …
caleywoods Jun 13, 2024
3450c9a
Prevent pa11y fails from failing the job step and not running the script
caleywoods Jun 13, 2024
4615960
Use the real env var for GH API auth
caleywoods Jun 13, 2024
f05d592
Re-run nightly scan to see if the GH action is working
caleywoods Jun 14, 2024
e1d208d
Reset scheduled run back to daily
caleywoods Jun 17, 2024
e04038d
Testing new github action template
caleywoods Jun 25, 2024
0a4d121
Restore nightly run and remove purposeful error on about page
caleywoods Jul 12, 2024
5120dde
Swap scan to hourly to test escaping of error body
caleywoods Jul 16, 2024
f595ff4
Run cron scan at 15 after the hour
caleywoods Jul 16, 2024
0cd4099
Fix syntax error
caleywoods Jul 16, 2024
11f1f6e
Revert troubleshooting changes
caleywoods Jul 16, 2024
5a1d403
Troubleshooting schedule and error
caleywoods Jul 17, 2024
fd50690
Run hourly at 15 after
caleywoods Jul 17, 2024
ca02309
Back to nightly
caleywoods Jul 17, 2024
913e924
Remove forced error
caleywoods Jul 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 45 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

jobs:
build:
build:
docker:
- image: cimg/ruby:3.2-browsers
environment:
Expand Down Expand Up @@ -30,7 +30,6 @@ jobs:
paths:
- vendor/bundle
key: v2-dependencies-bundler-{{ checksum "Gemfile.lock" }}

- restore_cache:
keys:
- v2-dependencies-npm-{{ checksum "package-lock.json" }}
Expand All @@ -42,23 +41,59 @@ jobs:
- node_modules
key: v2-dependencies-npm-{{ checksum "package-lock.json" }}
- run: npm run uswds-build
# We export the file list in pa11y_targets so that we can make pa11y-ci scan only those changed files in the "Run pa11yci" step
- run:
name: Jekyll build
name: Jekyll build and store pa11y_targets
# We export the changed file list in pa11y_targets source
# that we can make pa11y-ci scan only those changed files
# in the "Run pa11y scan on changed files" step if it's
# needed, a full site scan does not use the pa11y_targets file
command: |
bundle exec jekyll build
echo "export PA11Y_TARGETS=$(cat pa11y_targets | base64 --wrap=0)" >> "$BASH_ENV"
source "$BASH_ENV"
if test -f pa11y_targets; then
caleywoods marked this conversation as resolved.
Show resolved Hide resolved
echo "export PA11Y_TARGETS=$(cat pa11y_targets | base64 --wrap=0)" >> "$BASH_ENV"
source "$BASH_ENV"
fi
- run: npm run htmlproofer
- run:
name: Run rspec
command: bundle exec rspec `pwd`/spec/
# Invoke pa11y-ci and pass in our list of changed files
- run:
name: Run pa11yci
command: npm run pa11y-ci -- $(echo $PA11Y_TARGETS | base64 --decode)
# The nightly full pa11y scan is triggered from a scheduled pipeline
# which satisfies this condition
- when:
condition:
equal: [ schedule, << pipeline.trigger_source >> ]
steps:
- run:
name: Run full pa11y scan
command: ./serve-pa11yci && npm run pa11y-sitemap
# When someone pushes to a branch on GitHub with an open pull request
# it makes a webhook POST to CircleCI that satisfies this condition
- when:
condition:
equal: [ webhook, << pipeline.trigger_source >> ]
steps:
- run:
name: Run pa11y scan on changed files
command: |
if [[ -z "${PA11Y_TARGETS}" ]]; then
npm run pa11y-ci -- $(echo $PA11Y_TARGETS | base64 --decode)
else
echo "The pa11y targets environment variable was not found, no pa11y scan performed."
exit 1
fi
workflows:
version: 2
nightly:
triggers:
- schedule:
# Run nightly at 10am UTC / 5am ET
cron: "0 10 * * *"
filters:
branches:
only:
- caley/nightly-pa11y-scan
jobs:
- build
commit:
jobs:
- build
Loading