Skip to content

Commit 84ae206

Browse files
authored
ci: test and build when create pr (#8)
1 parent 2213a71 commit 84ae206

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test and Build
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
types: [opened, synchronize, reopened]
7+
8+
jobs:
9+
test-and-build:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [20.x]
15+
job-type: [test, build]
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Enable Corepack
22+
run: corepack enable
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
cache: "yarn"
28+
cache-dependency-path: "yarn.lock"
29+
node-version-file: ".nvmrc"
30+
31+
- name: Install dependencies
32+
run: yarn install --frozen-lockfile
33+
34+
- name: Run tests
35+
if: matrix.job-type == 'test'
36+
run: yarn test
37+
38+
- name: Build project
39+
if: matrix.job-type == 'build'
40+
run: yarn build
41+

0 commit comments

Comments
 (0)