4
4
workflow_dispatch :
5
5
6
6
jobs :
7
- accessibility_check_all_html :
7
+ accessibility_assessment_all_website_html :
8
8
runs-on : ubuntu-latest
9
9
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
11
11
steps :
12
12
- uses : actions/checkout@v3
13
13
35
35
- name : Build the book
36
36
run : poetry run jupyter-book build .
37
37
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
+
38
45
- name : Install Node.js and dependencies
39
46
run : |
40
47
apt-get update
@@ -44,28 +51,29 @@ jobs:
44
51
npm install --save-dev pa11y-ci
45
52
npx puppeteer browsers install chrome
46
53
47
- - name : Find all HTML files
48
- id : list_html
54
+ - name : Identify all HTML files in _build/html
55
+ id : map_html_targets
49
56
shell : bash
50
57
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
54
61
55
- - name : Run Pa11y on all HTML files and save output
62
+
63
+ - name : Run Pa11y CI on changed pages only and save output
56
64
id : run_pa11y
57
65
shell : bash
58
66
run : |
59
- num_files=$(jq length all_html_files .json)
67
+ num_files=$(jq length pa11y_targets .json)
60
68
touch pa11y_output.md
61
69
62
70
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
64
72
else
65
73
echo "### 🚦 Pa11y Accessibility Report" > pa11y_output.md
66
74
echo "" >> pa11y_output.md
67
75
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)
69
77
total_files=${#html_files[@]}
70
78
71
79
for i in "${!html_files[@]}"; do
@@ -80,12 +88,19 @@ jobs:
80
88
echo "$result" >> pa11y_output.md
81
89
echo '```' >> pa11y_output.md
82
90
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
83
93
echo "" >> pa11y_output.md
84
94
done
85
95
fi
86
96
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