Skip to content

Commit 68f47b3

Browse files
authored
Merge pull request #11 from adewale/claude/add-keyboardia-ci-support-17hD8
Add CI support to Keyboardia GitHub project
2 parents 2fd1dfb + 6b2a424 commit 68f47b3

File tree

1 file changed

+138
-0
lines changed

1 file changed

+138
-0
lines changed

.github/workflows/ci.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
working-directory: ./app
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
cache: 'npm'
25+
cache-dependency-path: app/package-lock.json
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run ESLint
31+
run: npm run lint
32+
33+
unit-tests:
34+
name: Unit Tests
35+
runs-on: ubuntu-latest
36+
defaults:
37+
run:
38+
working-directory: ./app
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
43+
- name: Setup Node.js
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: '20'
47+
cache: 'npm'
48+
cache-dependency-path: app/package-lock.json
49+
50+
- name: Install dependencies
51+
run: npm ci
52+
53+
- name: Run unit tests
54+
run: npm run test:unit
55+
56+
integration-tests:
57+
name: Integration Tests
58+
runs-on: ubuntu-latest
59+
defaults:
60+
run:
61+
working-directory: ./app
62+
steps:
63+
- name: Checkout repository
64+
uses: actions/checkout@v4
65+
66+
- name: Setup Node.js
67+
uses: actions/setup-node@v4
68+
with:
69+
node-version: '20'
70+
cache: 'npm'
71+
cache-dependency-path: app/package-lock.json
72+
73+
- name: Install app dependencies
74+
run: npm ci
75+
76+
- name: Install integration test dependencies
77+
run: npm ci
78+
working-directory: ./app/test/integration
79+
80+
- name: Run integration tests
81+
run: npm run test:integration
82+
83+
build:
84+
name: Build
85+
runs-on: ubuntu-latest
86+
defaults:
87+
run:
88+
working-directory: ./app
89+
steps:
90+
- name: Checkout repository
91+
uses: actions/checkout@v4
92+
93+
- name: Setup Node.js
94+
uses: actions/setup-node@v4
95+
with:
96+
node-version: '20'
97+
cache: 'npm'
98+
cache-dependency-path: app/package-lock.json
99+
100+
- name: Install dependencies
101+
run: npm ci
102+
103+
- name: Build application
104+
run: npm run build
105+
106+
e2e-tests:
107+
name: E2E Tests
108+
runs-on: ubuntu-latest
109+
defaults:
110+
run:
111+
working-directory: ./app
112+
steps:
113+
- name: Checkout repository
114+
uses: actions/checkout@v4
115+
116+
- name: Setup Node.js
117+
uses: actions/setup-node@v4
118+
with:
119+
node-version: '20'
120+
cache: 'npm'
121+
cache-dependency-path: app/package-lock.json
122+
123+
- name: Install dependencies
124+
run: npm ci
125+
126+
- name: Install Playwright browsers
127+
run: npx playwright install --with-deps chromium
128+
129+
- name: Run E2E tests
130+
run: npx playwright test
131+
132+
- name: Upload Playwright report
133+
uses: actions/upload-artifact@v4
134+
if: failure()
135+
with:
136+
name: playwright-report
137+
path: app/playwright-report/
138+
retention-days: 7

0 commit comments

Comments
 (0)