From a35269c81d0c30786f3e43d611a2006ca812d5e5 Mon Sep 17 00:00:00 2001 From: Silas Santini <70163606+pancakereport@users.noreply.github.com> Date: Wed, 26 Nov 2025 00:14:09 -0800 Subject: [PATCH 1/9] enable sitemap --- _quarto.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/_quarto.yml b/_quarto.yml index 59026a9..e763559 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -3,6 +3,7 @@ project: output-dir: docs book: + site-url: "https://ds100.org/debugging-guide/" favicon: data100_logo.png title: "Data 100 Debugging Guide" image: data100_logo.png From 94ea5466f0044e164dbff720b24d920f53f0af6b Mon Sep 17 00:00:00 2001 From: Silas Santini <70163606+pancakereport@users.noreply.github.com> Date: Wed, 26 Nov 2025 00:14:29 -0800 Subject: [PATCH 2/9] init workflow --- .github/workflows/a11y.yml | 86 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/a11y.yml diff --git a/.github/workflows/a11y.yml b/.github/workflows/a11y.yml new file mode 100644 index 0000000..e84579e --- /dev/null +++ b/.github/workflows/a11y.yml @@ -0,0 +1,86 @@ +name: Accessibility Checks (With Render) + +on: + push: + branches-ignore: + - gh-pages + workflow_dispatch: + +env: + PRODUCTION_URL: "https://ds100.org/debugging-guide/" + # must match the end of PRODUCTION_URL + # leave blank if at root + SITE_SUBDIR: "debugging-guide" + +jobs: + axe-audit: + runs-on: ubuntu-latest + + steps: + # 1. Checkout Code + - name: Checkout repository + uses: actions/checkout@v4 + + # 2. Setup Quarto + - name: Set up Quarto + uses: quarto-dev/quarto-actions/setup@v2 + + # 3. Setup Node.js (for Axe and http-server) + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + # 4. Install Python dependencies + - name: Install Python dependencies + run: pip install -r requirements.txt + + # 5. Render the Site + - name: Render Quarto Site + run: quarto render + + # 6. Install Tools + - name: Install Axe and Server + run: npm install -g @axe-core/cli http-server + + # 7. Start Local Server (Background Process) + - name: Start Local Server + run: | + # Mimic the production path structure exactly with + # the local server + mkdir -p public/${{ env.SITE_SUBDIR }} + cp -r docs/* public/${{ env.SITE_SUBDIR }}/ + + # Serve the 'public' folder on port 3000 + npx http-server ./public -p 3000 > /dev/null 2>&1 & + + sleep 5 + + # 8. Run Axe Scan + - name: Run Accessibility Scan + id: axe-scan + run: | + # Swap the Production URL for Localhost + Subdirectory + LOCAL_URL="http://localhost:3000/${{ env.SITE_SUBDIR }}" + + URLS=$(cat docs/sitemap.xml | \ + sed -n 's/.*\(.*\)<\/loc>.*/\1/p' | \ + sed "s|${{ env.PRODUCTION_URL }}|$LOCAL_URL|" | \ + tr '\n' ' ') + + echo "Scanning the following pages:" + echo "$URLS" + + # Run Axe + axe $URLS \ + --tags wcag2a,wcag2aa,wcag21a,wcag21aa \ + --save axe-report.json \ + --exit + + # 9. Upload Report (Runs even if Step 8 fails) + - name: Upload Accessibility Report + if: always() + uses: actions/upload-artifact@v4 + with: + name: axe-report + path: axe-report.json \ No newline at end of file From 76028bd9ddf4bb407ee2a1f607881ae51fec4e7b Mon Sep 17 00:00:00 2001 From: Silas Santini <70163606+pancakereport@users.noreply.github.com> Date: Wed, 26 Nov 2025 00:18:46 -0800 Subject: [PATCH 3/9] fix triggers --- .github/workflows/a11y.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/a11y.yml b/.github/workflows/a11y.yml index e84579e..192fe44 100644 --- a/.github/workflows/a11y.yml +++ b/.github/workflows/a11y.yml @@ -2,8 +2,6 @@ name: Accessibility Checks (With Render) on: push: - branches-ignore: - - gh-pages workflow_dispatch: env: From 84361b15e76c093269dde60586599adfa5ce8579 Mon Sep 17 00:00:00 2001 From: Silas Santini <70163606+pancakereport@users.noreply.github.com> Date: Wed, 26 Nov 2025 00:20:22 -0800 Subject: [PATCH 4/9] python itself is not a python requirement --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c31af8b..4611fb8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,6 @@ numpy<2 otter-grader==5.4.0 pandas==2.0.2 plotly==5.13.1 -python==3.11.9 requests==2.28.2 scikit-image==0.25.2 scikit-learn==1.2.2 From 7b165a87ffd5c2e6f51f9fec5a6b0734e322463b Mon Sep 17 00:00:00 2001 From: Silas Santini <70163606+pancakereport@users.noreply.github.com> Date: Wed, 26 Nov 2025 00:26:20 -0800 Subject: [PATCH 5/9] cache python dependencies --- .github/workflows/a11y.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/a11y.yml b/.github/workflows/a11y.yml index 192fe44..3e00b22 100644 --- a/.github/workflows/a11y.yml +++ b/.github/workflows/a11y.yml @@ -29,19 +29,26 @@ jobs: with: node-version: '20' - # 4. Install Python dependencies + # 4. Setup Python + - name: Set up Python + - uses: actions/setup-python@v4 + with: + python-version: '3.11.9' + cache: 'pip' + + # 5. Install Python dependencies - name: Install Python dependencies run: pip install -r requirements.txt - # 5. Render the Site + # 6. Render the Site - name: Render Quarto Site run: quarto render - # 6. Install Tools + # 7. Install Tools - name: Install Axe and Server run: npm install -g @axe-core/cli http-server - # 7. Start Local Server (Background Process) + # 8. Start Local Server (Background Process) - name: Start Local Server run: | # Mimic the production path structure exactly with @@ -54,7 +61,7 @@ jobs: sleep 5 - # 8. Run Axe Scan + # 9. Run Axe Scan - name: Run Accessibility Scan id: axe-scan run: | @@ -75,7 +82,7 @@ jobs: --save axe-report.json \ --exit - # 9. Upload Report (Runs even if Step 8 fails) + # 10. Upload Report (Runs even if previous step fails) - name: Upload Accessibility Report if: always() uses: actions/upload-artifact@v4 From c8e605e36994424c2b1e59bdd0c31098b1a05d8c Mon Sep 17 00:00:00 2001 From: Silas Santini <70163606+pancakereport@users.noreply.github.com> Date: Wed, 26 Nov 2025 00:27:42 -0800 Subject: [PATCH 6/9] typo --- .github/workflows/a11y.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/a11y.yml b/.github/workflows/a11y.yml index 3e00b22..7a7f1f6 100644 --- a/.github/workflows/a11y.yml +++ b/.github/workflows/a11y.yml @@ -31,7 +31,7 @@ jobs: # 4. Setup Python - name: Set up Python - - uses: actions/setup-python@v4 + uses: actions/setup-python@v4 with: python-version: '3.11.9' cache: 'pip' From da5d1f7cb47d8ee749b24931288dcf1abe1cbdc8 Mon Sep 17 00:00:00 2001 From: Silas Santini <70163606+pancakereport@users.noreply.github.com> Date: Wed, 26 Nov 2025 00:36:16 -0800 Subject: [PATCH 7/9] add tinytex --- .github/workflows/a11y.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/a11y.yml b/.github/workflows/a11y.yml index 7a7f1f6..8ffc3f5 100644 --- a/.github/workflows/a11y.yml +++ b/.github/workflows/a11y.yml @@ -1,4 +1,4 @@ -name: Accessibility Checks (With Render) +name: Accessibility Checks on: push: @@ -22,33 +22,37 @@ jobs: # 2. Setup Quarto - name: Set up Quarto uses: quarto-dev/quarto-actions/setup@v2 + + # 3. Install TinyText (for rendering) + - name: Install TinyTeX + uses: quarto-dev/quarto-actions/tinytex@v2 - # 3. Setup Node.js (for Axe and http-server) + # 4. Setup Node.js (for Axe and http-server) - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: '20' - # 4. Setup Python + # 5. Setup Python - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.11.9' cache: 'pip' - # 5. Install Python dependencies + # 6. Install Python dependencies - name: Install Python dependencies run: pip install -r requirements.txt - # 6. Render the Site + # 7. Render the Site - name: Render Quarto Site run: quarto render - # 7. Install Tools + # 8. Install Tools - name: Install Axe and Server run: npm install -g @axe-core/cli http-server - # 8. Start Local Server (Background Process) + # 9. Start Local Server (Background Process) - name: Start Local Server run: | # Mimic the production path structure exactly with @@ -61,7 +65,7 @@ jobs: sleep 5 - # 9. Run Axe Scan + # 10. Run Axe Scan - name: Run Accessibility Scan id: axe-scan run: | @@ -82,7 +86,7 @@ jobs: --save axe-report.json \ --exit - # 10. Upload Report (Runs even if previous step fails) + # 11. Upload Report (Runs even if previous step fails) - name: Upload Accessibility Report if: always() uses: actions/upload-artifact@v4 From b72fe0a8866b569c154b074ea4fd805ec6d28dfd Mon Sep 17 00:00:00 2001 From: Silas Santini <70163606+pancakereport@users.noreply.github.com> Date: Wed, 26 Nov 2025 00:42:06 -0800 Subject: [PATCH 8/9] try tinytex different way --- .github/workflows/a11y.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/a11y.yml b/.github/workflows/a11y.yml index 8ffc3f5..64846e3 100644 --- a/.github/workflows/a11y.yml +++ b/.github/workflows/a11y.yml @@ -19,40 +19,40 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - # 2. Setup Quarto + # 2. Setup Quarto with TinyTex - name: Set up Quarto uses: quarto-dev/quarto-actions/setup@v2 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tinytex: true - # 3. Install TinyText (for rendering) - - name: Install TinyTeX - uses: quarto-dev/quarto-actions/tinytex@v2 - - # 4. Setup Node.js (for Axe and http-server) + # 3. Setup Node.js (for Axe and http-server) - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: '20' - # 5. Setup Python + # 4. Setup Python - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.11.9' cache: 'pip' - # 6. Install Python dependencies + # 5. Install Python dependencies - name: Install Python dependencies run: pip install -r requirements.txt - # 7. Render the Site + # 6. Render the Site - name: Render Quarto Site run: quarto render - # 8. Install Tools + # 7. Install Tools - name: Install Axe and Server run: npm install -g @axe-core/cli http-server - # 9. Start Local Server (Background Process) + # 8. Start Local Server (Background Process) - name: Start Local Server run: | # Mimic the production path structure exactly with @@ -65,7 +65,7 @@ jobs: sleep 5 - # 10. Run Axe Scan + # 9. Run Axe Scan - name: Run Accessibility Scan id: axe-scan run: | @@ -86,7 +86,7 @@ jobs: --save axe-report.json \ --exit - # 11. Upload Report (Runs even if previous step fails) + # 10. Upload Report (Runs even if previous step fails) - name: Upload Accessibility Report if: always() uses: actions/upload-artifact@v4 From 9b9e93825d21872d1c448c1be0d657d0c0bc0591 Mon Sep 17 00:00:00 2001 From: Silas Santini <70163606+pancakereport@users.noreply.github.com> Date: Wed, 26 Nov 2025 00:46:48 -0800 Subject: [PATCH 9/9] a11y status badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7e7366f..99bccc4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Debugging Guide +[![Accessibility Checks](https://github.com/DS-100/debugging-guide/actions/workflows/a11y.yml/badge.svg)](https://github.com/DS-100/debugging-guide/actions/workflows/a11y.yml) + Website link: https://ds100.org/debugging-guide/ ## Repo Setup