Skip to content

Commit cca3c2b

Browse files
authored
Merge pull request #7 from robocode13/github-actions
Add GitHub Actions workflow to build and test the code
2 parents 2c4c3d7 + e756ea8 commit cca3c2b

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/build-test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Node.js CI with pnpm
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build-and-test:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
# Define a matrix for different Node.js versions
17+
matrix:
18+
node-version: [18.x, 20.x, 22.x]
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Install pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
version: latest
28+
29+
- name: Setup Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
cache: 'pnpm'
34+
35+
- name: Install dependencies with pnpm
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Run build (TypeScript compilation)
39+
run: pnpm run build
40+
41+
- name: Run tests (Vitest)
42+
run: pnpm run test -- --run

0 commit comments

Comments
 (0)