Skip to content

Commit ad9c563

Browse files
authored
Update accessibility-scan.yml
1 parent 9157318 commit ad9c563

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

.github/workflows/accessibility-scan.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,36 @@ jobs:
1313
- name: Set up Node.js
1414
uses: actions/setup-node@v3
1515
with:
16-
node-version: '16'
16+
node-version: '14'
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 ChromeDriver
24+
- name: Install Chrome and ChromeDriver
2525
run: |
2626
sudo apt-get update
27-
sudo apt-get install -y google-chrome-stable chromedriver
27+
sudo apt-get install -y wget unzip
28+
wget -O /tmp/chromedriver.zip https://storage.googleapis.com/chrome-for-testing-public/133.0.5735.90/linux64/chromedriver-linux64.zip
29+
unzip /tmp/chromedriver.zip -d /tmp/
30+
sudo mv /tmp/chromedriver-linux64/chromedriver /usr/local/bin/chromedriver
31+
sudo chmod +x /usr/local/bin/chromedriver
32+
echo "ChromeDriver installed at $(which chromedriver)"
2833
2934
- name: Start local server
3035
run: |
3136
nohup http-server ./ &
32-
3337
- name: Wait for the server to start
34-
run: sleep 5 # Ensures server is ready before scanning
38+
run: sleep 5 # Wait for 5 seconds to ensure server is ready
3539

3640
- name: Create axe-reports directory
3741
run: mkdir -p ./axe-reports
3842

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-
4443
- name: Run axe-core accessibility scan and save results as JSON
4544
run: |
46-
npx @axe-core/cli http://localhost:8080 \
47-
--chrome-options="--no-sandbox --disable-dev-shm-usage" \
48-
--save ./axe-reports/accessibility-report.json
45+
npx @axe-core/cli http://localhost:8080 --chromedriver-path /usr/local/bin/chromedriver --save ./axe-reports/accessibility-report.json
4946
echo "Results saved to ./axe-reports/accessibility-report.json"
5047
5148
- name: Verify if the report is created

0 commit comments

Comments
 (0)