Skip to content

Commit

Permalink
Merge pull request #30 from sor4chi/feat/type-check
Browse files Browse the repository at this point in the history
chore: add type check
  • Loading branch information
sor4chi authored Dec 3, 2023
2 parents 7661f40 + 33d04ef commit 7f3da8b
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,48 @@ jobs:
- name: Test
run: pnpm test

test-type:
name: Test Type
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Launch Turbo Remote Cache Server
uses: dtinth/setup-github-actions-caching-for-turbo@v1.1.0
with:
cache-prefix: turbogha_

- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Test
run: pnpm test:type

build:
name: Build
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"format:check": "turbo format:check",
"build": "turbo build",
"test": "turbo test",
"test:type": "turbo test:type",
"release": "pnpm build && changeset publish"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/hono-do/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
"format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
"build": "tsc -p tsconfig.build.json",
"test": "vitest"
"test": "vitest",
"test:type": "vitest typecheck"
},
"keywords": [
"hono",
Expand Down
3 changes: 3 additions & 0 deletions packages/hono-do/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
globals: true,
typecheck: {
include: ["tests/**/*.test.ts"],
},
},
});
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
"lib": ["esnext"]
}
}
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"format:check": {},
"test": {
"dependsOn": ["^build"]
},
"test:type": {
"dependsOn": ["^build"]
}
}
}

0 comments on commit 7f3da8b

Please sign in to comment.