@@ -142,3 +142,99 @@ jobs:
142142
143143 - name : Run end-to-end tests
144144 run : python manage.py test website.tests.test_member_e2e --settings=makeabilitylab.settings_test --verbosity=2
145+
146+ # Accessibility sweep (Pa11y + Axe, WCAG 2.0 AA). CONTRIBUTING requires Pa11y
147+ # on UI changes but nothing enforced it (#1278 item 6). This wires it in.
148+ #
149+ # Like `test` and `e2e`, it is REPORT-ONLY — it surfaces violations in the run
150+ # Summary but never fails the build (so a pre-existing violation doesn't sit
151+ # red next to every master deploy). Tighten to blocking later once the current
152+ # findings are triaged.
153+ #
154+ # The local `.pa11yci.json` targets the docker-compose host with the
155+ # maintainer's real DB snapshot; CI has no snapshot, so we build a fresh DB
156+ # from models, seed deterministic demo content (seed_demo_projects +
157+ # seed_demo_news), serve it with a native runserver, and scan the localhost
158+ # URLs in `.pa11yci.ci.json`.
159+ a11y :
160+ runs-on : ubuntu-latest
161+
162+ services :
163+ postgres :
164+ image : postgres:16
165+ env :
166+ POSTGRES_DB : makeability
167+ POSTGRES_USER : admin
168+ POSTGRES_PASSWORD : password
169+ ports :
170+ - 5432:5432
171+ options : >-
172+ --health-cmd "pg_isready -U admin -d makeability"
173+ --health-interval 10s
174+ --health-timeout 5s
175+ --health-retries 5
176+
177+ env :
178+ DATABASE_HOST : localhost
179+ DATABASE_PORT : 5432
180+ # DJANGO_ENV=DEBUG -> DEBUG=True, so the dev runserver serves media/static
181+ # and renders real error pages while pa11y scans.
182+ DJANGO_ENV : DEBUG
183+ DJANGO_SETTINGS_MODULE : makeabilitylab.settings_test
184+
185+ steps :
186+ - uses : actions/checkout@v4
187+
188+ # ImageMagick + Ghostscript power the PDF->thumbnail path the demo
189+ # publications hit on save; libpq-dev builds psycopg2.
190+ - name : Install system dependencies
191+ run : |
192+ sudo apt-get update
193+ sudo apt-get install -y --no-install-recommends imagemagick ghostscript libpq-dev
194+ sudo cp imagemagick-policy.xml /etc/ImageMagick-6/policy.xml
195+
196+ - name : Set up Python
197+ uses : actions/setup-python@v5
198+ with :
199+ python-version : " 3.13"
200+ cache : pip
201+
202+ - name : Install Python dependencies
203+ run : pip install -r requirements.txt
204+
205+ # Build the website schema from models (migrations are gitignored;
206+ # settings_test sets MIGRATION_MODULES={'website': None}, so --run-syncdb
207+ # creates the tables directly) and seed deterministic demo content.
208+ - name : Build schema and seed demo data
209+ run : |
210+ python manage.py migrate --run-syncdb
211+ python manage.py seed_demo_projects
212+ python manage.py seed_demo_news
213+
214+ - name : Start dev server
215+ run : |
216+ python manage.py runserver 0.0.0.0:8000 --noreload &
217+ echo "Waiting for the server to come up…"
218+ for i in $(seq 1 30); do
219+ if curl -sf -o /dev/null http://localhost:8000/; then
220+ echo "Server is up."; exit 0
221+ fi
222+ sleep 1
223+ done
224+ echo "Server did not start in time"; exit 1
225+
226+ - name : Install pa11y-ci
227+ run : npm install -g pa11y-ci
228+
229+ # Report-only: `|| true` so violations never fail the job. Output is teed
230+ # to the log and a trimmed tail posted to the run Summary.
231+ - name : Run Pa11y accessibility sweep
232+ run : |
233+ pa11y-ci --config .pa11yci.ci.json 2>&1 | tee pa11y-output.txt || true
234+ {
235+ echo "## Accessibility (Pa11y + Axe, WCAG2AA) — report-only"
236+ echo
237+ echo '```'
238+ tail -n 60 pa11y-output.txt
239+ echo '```'
240+ } >> "$GITHUB_STEP_SUMMARY"
0 commit comments