Skip to content

Commit c6e16dc

Browse files
committed
build: add github workflow
1 parent 1fb4be6 commit c6e16dc

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 'lts/*'
23+
24+
- uses: pnpm/action-setup@v2.2.2
25+
name: Install pnpm
26+
id: pnpm-install
27+
with:
28+
version: 7
29+
run_install: false
30+
31+
- name: Get pnpm store directory
32+
id: pnpm-cache
33+
run: |
34+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
35+
36+
- uses: actions/cache@v3
37+
name: Setup pnpm cache
38+
with:
39+
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
40+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
41+
restore-keys: |
42+
${{ runner.os }}-pnpm-store-
43+
44+
- name: Install dependencies
45+
run: pnpm install
46+
47+
- name: Linter
48+
run: pnpm run format:ci
49+
50+
- name: Test
51+
run: pnpm test
52+
53+

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ package-lock.json
44
coverage
55
test
66
.idea
7+
.github

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"type": "commonjs",
77
"scripts": {
88
"format": "rome format . --indent-style space --write",
9+
"format:ci": "rome format . --indent-style space",
910
"test": "vitest",
1011
"test:watch": "vitest --watch",
1112
"coverage": "vitest run --coverage",

0 commit comments

Comments
 (0)