Skip to content

Commit e3e4ece

Browse files
Merge pull request #334 from coding-for-reproducible-research/accessibility_assessment_complete
Update .yml file
2 parents a2f4a05 + 7aaec4a commit e3e4ece

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

.github/workflows/accessibility_complete.yml

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
accessibility_check_all_html:
7+
accessibility_assessment_all_website_html:
88
runs-on: ubuntu-latest
99
container:
10-
image: mcr.microsoft.com/playwright:v1.42.1-jammy
10+
image: mcr.microsoft.com/playwright:v1.42.1-jammy # includes Chromium, Node, and tools
1111
steps:
1212
- uses: actions/checkout@v3
1313

@@ -35,6 +35,13 @@ jobs:
3535
- name: Build the book
3636
run: poetry run jupyter-book build .
3737

38+
- name: Upload error logs
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: error-logs
42+
path: _build/html/reports/pathways/related_courses.err.log
43+
continue-on-error: true
44+
3845
- name: Install Node.js and dependencies
3946
run: |
4047
apt-get update
@@ -44,28 +51,29 @@ jobs:
4451
npm install --save-dev pa11y-ci
4552
npx puppeteer browsers install chrome
4653
47-
- name: Find all HTML files
48-
id: list_html
54+
- name: Identify all HTML files in _build/html
55+
id: map_html_targets
4956
shell: bash
5057
run: |
51-
find _build/html -type f -name '*.html' | jq -R . | jq -s . > all_html_files.json
52-
echo "HTML files to check:"
53-
cat all_html_files.json
58+
find _build/html -type f -name '*.html' | jq -R . | jq -s . > pa11y_targets.json
59+
echo "Generated pa11y_targets.json:"
60+
cat pa11y_targets.json
5461
55-
- name: Run Pa11y on all HTML files and save output
62+
63+
- name: Run Pa11y CI on changed pages only and save output
5664
id: run_pa11y
5765
shell: bash
5866
run: |
59-
num_files=$(jq length all_html_files.json)
67+
num_files=$(jq length pa11y_targets.json)
6068
touch pa11y_output.md
6169
6270
if [ "$num_files" -eq 0 ]; then
63-
echo "No HTML files found to check." | tee pa11y_output.md
71+
echo "No relevant HTML files to check. Skipping Pa11y." | tee pa11y_output.md
6472
else
6573
echo "### 🚦 Pa11y Accessibility Report" > pa11y_output.md
6674
echo "" >> pa11y_output.md
6775
68-
mapfile -t html_files < <(jq -r '.[]' all_html_files.json | sort -u)
76+
mapfile -t html_files < <(jq -r '.[]' pa11y_targets.json | sort -u)
6977
total_files=${#html_files[@]}
7078
7179
for i in "${!html_files[@]}"; do
@@ -80,12 +88,19 @@ jobs:
8088
echo "$result" >> pa11y_output.md
8189
echo '```' >> pa11y_output.md
8290
91+
base=$(basename "$file" .html)
92+
echo "_⚠️ Any errors likely originates from the source file (e.g., \`filename.md\`, \`filename.ipynb\`) used to generate the HTML._" >> pa11y_output.md
8393
echo "" >> pa11y_output.md
8494
done
8595
fi
8696
87-
- name: Upload Pa11y Report
88-
uses: actions/upload-artifact@v4
89-
with:
90-
name: pa11y-accessibility-report
91-
path: pa11y_output.md
97+
98+
- name: 🔍 Debug comment body
99+
run: |
100+
echo "------- BEGIN COMMENT BODY -------"
101+
cat pa11y_output.md
102+
echo "-------- END COMMENT BODY --------"
103+
104+
105+
106+

0 commit comments

Comments
 (0)