Skip to content

Commit c2be78f

Browse files
Copilotbenkutil
andcommitted
feat: add GitHub Actions workflows for quality and accessibility testing
Co-authored-by: benkutil <228373+benkutil@users.noreply.github.com>
1 parent 3b2c8f5 commit c2be78f

5 files changed

Lines changed: 89 additions & 3 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Accessibility Tests
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
accessibility:
11+
name: Accessibility Testing
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version-file: ".nvmrc"
22+
cache: "npm"
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Build site
28+
run: npm run build
29+
30+
- name: Serve site
31+
run: npx serve _site -l 8080 &
32+
33+
- name: Wait for server
34+
run: npx wait-on http://localhost:8080 --timeout 30000
35+
36+
- name: Run Pa11y accessibility tests
37+
run: npm run test:accessibility

.github/workflows/quality.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Quality Checks
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
quality:
11+
name: Linting and Build
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version-file: ".nvmrc"
22+
cache: "npm"
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Run Prettier
28+
run: npm run lint:format
29+
30+
- name: Run Stylelint
31+
run: npm run lint:css
32+
33+
- name: Run ESLint
34+
run: npm run lint:js
35+
36+
- name: Build site
37+
run: npm run build
38+
39+
- name: Upload build artifacts
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: site-build
43+
path: _site/
44+
retention-days: 7

.pa11yci.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"defaults": {
33
"timeout": 30000,
4-
"wait": 1000
4+
"wait": 1000,
5+
"chromeLaunchConfig": {
6+
"args": ["--no-sandbox", "--disable-setuid-sandbox"]
7+
}
58
},
69
"urls": ["http://localhost:8080/"]
710
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@
4747
"outdent": "^0.8.0",
4848
"pa11y-ci": "^4.0.1",
4949
"prettier": "^3.8.1",
50+
"serve": "^14.2.5",
5051
"stylelint": "^17.1.0",
51-
"stylelint-config-standard": "^40.0.0"
52+
"stylelint-config-standard": "^40.0.0",
53+
"wait-on": "^9.0.3"
5254
},
5355
"dependencies": {
5456
"@11ty/eleventy-upgrade-help": "^2.0.5",

src/_includes/layouts/base.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

0 commit comments

Comments
 (0)