@@ -13,30 +13,38 @@ jobs:
1313 - name : Set up Node.js
1414 uses : actions/setup-node@v3
1515 with :
16- node-version : ' 16' # Upgraded to Node.js 16 to fix syntax errors
16+ node-version : ' 16'
1717
1818 - name : Install dependencies
1919 run : npm install
2020
2121 - name : Install @axe-core/cli and http-server
2222 run : npm install -g @axe-core/cli http-server
2323
24- - name : Install matching ChromeDriver version
25- run : npx browser-driver-manager install chrome || echo "Skipping if failed"
24+ - name : Install ChromeDriver
25+ run : |
26+ sudo apt-get update
27+ sudo apt-get install -y google-chrome-stable chromedriver
2628
2729 - name : Start local server
2830 run : |
2931 nohup http-server ./ &
32+
3033 - name : Wait for the server to start
31- run : sleep 5 # Wait for 5 seconds to ensure server is ready
34+ run : sleep 5 # Ensures server is ready before scanning
3235
3336 - name : Create axe-reports directory
3437 run : mkdir -p ./axe-reports
3538
39+ - name : Restart Chrome to prevent conflicts
40+ run : |
41+ pkill -x chrome || echo "No existing Chrome instances running"
42+ google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 &
43+
3644 - name : Run axe-core accessibility scan and save results as JSON
3745 run : |
3846 npx @axe-core/cli http://localhost:8080 \
39- --chrome-options="--no-sandbox --disable-dev-shm-usage --user-data-dir=/tmp/chrome-profile " \
47+ --chrome-options="--no-sandbox --disable-dev-shm-usage" \
4048 --save ./axe-reports/accessibility-report.json
4149 echo "Results saved to ./axe-reports/accessibility-report.json"
4250
0 commit comments