Skip to content

Commit

Permalink
Add CI for JS parts (#260)
Browse files Browse the repository at this point in the history
* CI for JS parts

* Add vitest
  • Loading branch information
kylebarron authored Nov 22, 2023
1 parent b5d2f30 commit 7cb5d88
Show file tree
Hide file tree
Showing 13 changed files with 986 additions and 21 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/test-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
push:
branches:
- 'main'
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
lint-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Volta
uses: volta-cli/action@v4

- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}

- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install
run: npm install

- name: Prettier check
run: npm run fmt:check

- name: Type check
run: npm run typecheck

- name: Test
run: npm run test
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tabWidth": 2,
"semi": true,
"trailingComma": "all"
}
Loading

0 comments on commit 7cb5d88

Please sign in to comment.