-
Notifications
You must be signed in to change notification settings - Fork 118
77 lines (60 loc) · 1.77 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
env:
HUSKY: 0 # for disable husky on ci
jobs:
commitlint:
if: github.event_name == 'pull_request'
name: CommitLint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node v20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
# https://docs.npmjs.com/cli/v10/commands/npm-ci
- name: Install Package
run: npm ci
# https://commitlint.js.org/guides/ci-setup.html#github-actions
- name: Validate PR commits with commitlint
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose --color
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 21.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Testing with Node.js v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
# Checks if package-lock.json is Up To Date
# https://www.npmjs.com/package/package-lock-utd
- name: Check package-lock.json
run: npm exec --yes [email protected]
# https://docs.npmjs.com/cli/v10/commands/npm-ci
- name: Install Package
run: npm ci
- name: Run Lint
run: npm run lint
- name: Run Test
run: npm run test:ci
- name: Run Test with vitest
run: npm run test:vitest
- name: Run Build
run: npm run build