Skip to content

Commit 7cb5d88

Browse files
authored
Add CI for JS parts (#260)
* CI for JS parts * Add vitest
1 parent b5d2f30 commit 7cb5d88

13 files changed

+986
-21
lines changed

.github/workflows/test-js.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
14+
jobs:
15+
lint-and-test:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Volta
23+
uses: volta-cli/action@v4
24+
25+
- name: Get npm cache directory
26+
id: npm-cache-dir
27+
shell: bash
28+
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
29+
30+
- uses: actions/cache@v3
31+
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
32+
with:
33+
path: ${{ steps.npm-cache-dir.outputs.dir }}
34+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-node-
37+
38+
- name: Install
39+
run: npm install
40+
41+
- name: Prettier check
42+
run: npm run fmt:check
43+
44+
- name: Type check
45+
run: npm run typecheck
46+
47+
- name: Test
48+
run: npm run test

.prettierrc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"tabWidth": 2,
3+
"semi": true,
4+
"trailingComma": "all"
5+
}

0 commit comments

Comments
 (0)