Skip to content

Commit c4d065b

Browse files
adriancofieclaude
andcommitted
(#15) Configure CI workflow for GitHub Actions
Configure GitHub Actions CI pipeline that runs on push and PR to main/develop branches. Includes linting, test coverage, and build across Node.js 20.x and 22.x. Coverage and build artifacts are uploaded and retained for 7 days. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8690851 commit c4d065b

2 files changed

Lines changed: 115 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
permissions:
10+
contents: read
11+
packages: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
lint:
19+
name: Lint
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Install pnpm
26+
uses: pnpm/action-setup@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 20.x
32+
cache: pnpm
33+
34+
- name: Authenticate GitHub Packages
35+
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
36+
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile
39+
40+
- name: Run linter
41+
run: pnpm run lint
42+
43+
test:
44+
name: Test (Node ${{ matrix.node-version }})
45+
runs-on: ubuntu-latest
46+
strategy:
47+
matrix:
48+
node-version: [20.x, 22.x]
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@v4
52+
53+
- name: Install pnpm
54+
uses: pnpm/action-setup@v4
55+
56+
- name: Setup Node.js ${{ matrix.node-version }}
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: ${{ matrix.node-version }}
60+
cache: pnpm
61+
62+
- name: Authenticate GitHub Packages
63+
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
64+
65+
- name: Install dependencies
66+
run: pnpm install --frozen-lockfile
67+
68+
- name: Run tests with coverage
69+
run: pnpm run test:coverage
70+
71+
- name: Upload coverage report
72+
if: matrix.node-version == '20.x'
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: coverage-report
76+
path: coverage/
77+
retention-days: 7
78+
79+
build:
80+
name: Build (Node ${{ matrix.node-version }})
81+
runs-on: ubuntu-latest
82+
strategy:
83+
matrix:
84+
node-version: [20.x, 22.x]
85+
steps:
86+
- name: Checkout code
87+
uses: actions/checkout@v4
88+
89+
- name: Install pnpm
90+
uses: pnpm/action-setup@v4
91+
92+
- name: Setup Node.js ${{ matrix.node-version }}
93+
uses: actions/setup-node@v4
94+
with:
95+
node-version: ${{ matrix.node-version }}
96+
cache: pnpm
97+
98+
- name: Authenticate GitHub Packages
99+
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
100+
101+
- name: Install dependencies
102+
run: pnpm install --frozen-lockfile
103+
104+
- name: Build
105+
run: pnpm run build
106+
107+
- name: Upload build artifacts
108+
if: matrix.node-version == '20.x'
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: build-output
112+
path: dist/
113+
retention-days: 7

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@
115115
"vitest": "^3.0.0",
116116
"vitest-axe": "^0.1.0"
117117
},
118+
"packageManager": "pnpm@8.6.12",
118119
"engines": {
119-
"node": ">=18.0.0"
120+
"node": ">=20.0.0"
120121
}
121122
}

0 commit comments

Comments
 (0)