|
27 | 27 |
|
28 | 28 | - name: Check per-page SEO front matter (description:) |
29 | 29 | run: python scripts/check_seo_frontmatter.py |
| 30 | + |
| 31 | + media-a11y: |
| 32 | + # Source-level a11y conventions that html-proofer does NOT cover: YouTube |
| 33 | + # iframe title=, <video> aria-label, and lazy empty alt (alt=""). See |
| 34 | + # scripts/check_a11y.py. Complements the link-check job below. |
| 35 | + runs-on: ubuntu-latest |
| 36 | + steps: |
| 37 | + - name: Checkout |
| 38 | + uses: actions/checkout@v4 |
| 39 | + |
| 40 | + - name: Setup Python |
| 41 | + uses: actions/setup-python@v5 |
| 42 | + with: |
| 43 | + python-version: "3.x" |
| 44 | + |
| 45 | + - name: Check media a11y (iframe title, video aria-label, image alt) |
| 46 | + run: python scripts/check_a11y.py --ci |
| 47 | + |
| 48 | + link-check: |
| 49 | + # Validate the BUILT site with html-proofer: broken internal links, broken |
| 50 | + # anchors, missing image alt, and malformed HTML. External links are NOT |
| 51 | + # checked here (slow/flaky); a separate non-blocking job can cover those. |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - name: Checkout |
| 55 | + uses: actions/checkout@v4 |
| 56 | + |
| 57 | + - name: Setup Ruby |
| 58 | + uses: ruby/setup-ruby@v1 |
| 59 | + with: |
| 60 | + ruby-version: "3.3.11" |
| 61 | + bundler-cache: true |
| 62 | + cache-version: 0 |
| 63 | + |
| 64 | + - name: Build site (production baseurl) |
| 65 | + run: bundle exec jekyll build --baseurl "/physcomp" |
| 66 | + env: |
| 67 | + JEKYLL_ENV: production |
| 68 | + |
| 69 | + - name: Install html-proofer |
| 70 | + run: gem install html-proofer -v 5.0.9 |
| 71 | + |
| 72 | + - name: Proof built site (internal links, anchors, image alt, HTML) |
| 73 | + # --swap-urls strips the /physcomp baseurl so absolute internal links |
| 74 | + # resolve against _site/. External link checking is disabled (slow/flaky). |
| 75 | + # |
| 76 | + # --ignore-files: each entry is tracked debt, not a silent skip: |
| 77 | + # * signals .+/index.html + IntroTo*.html -> stale generated nbconvert |
| 78 | + # notebooks (issue #115) |
| 79 | + # * /arduino/accel.html -> WIP draft, missing screenshot (issue #115) |
| 80 | + # * /esp32/capacitive-touch.html -> WIP lesson, missing diagrams (issue #114) |
| 81 | + # Remove an entry once its issue is resolved so the gate covers that page. |
| 82 | + # Each --ignore-files pattern must be wrapped in /slashes/ to be treated |
| 83 | + # as a regex (a bare string is an exact-path match); internal slashes are |
| 84 | + # escaped as \/. |
| 85 | + run: | |
| 86 | + htmlproofer ./_site \ |
| 87 | + --disable-external \ |
| 88 | + --swap-urls "^/physcomp:" \ |
| 89 | + --no-enforce-https \ |
| 90 | + --ignore-files "/\/signals\/.+\/index\.html/,/\/signals\/IntroTo[A-Za-z]+\.html/,/\/arduino\/accel\.html/,/\/esp32\/capacitive-touch\.html/" |
0 commit comments