Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add check workflows #11

Merged
merged 6 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 173 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: Check

on:
pull_request:

jobs:
lint-check:
name: Lint Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Launch Turbo Remote Cache Server
uses: dtinth/[email protected]
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: Lint
run: pnpm lint:check

format-check:
name: Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Launch Turbo Remote Cache Server
uses: dtinth/[email protected]
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: Format
run: pnpm format:check

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

- name: Launch Turbo Remote Cache Server
uses: dtinth/[email protected]
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

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Launch Turbo Remote Cache Server
uses: dtinth/[email protected]
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: Build
run: pnpm build
2 changes: 2 additions & 0 deletions examples/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"version": "0.0.1",
"scripts": {
"lint": "eslint --fix --ext .ts,.tsx src",
"lint:check": "eslint --ext .ts,.tsx src",
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
"format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
"dev": "wrangler dev src/index.ts",
"deploy": "wrangler deploy --minify src/index.ts"
},
Expand Down
2 changes: 2 additions & 0 deletions examples/counter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"version": "0.0.1",
"scripts": {
"lint": "eslint --fix --ext .ts,.tsx src",
"lint:check": "eslint --ext .ts,.tsx src",
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
"format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
"dev": "wrangler dev src/index.ts",
"deploy": "wrangler deploy --minify src/index.ts"
},
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"private": true,
"scripts": {
"lint": "turbo lint",
"lint:check": "turbo lint:check",
"format": "turbo format",
"format:check": "turbo format:check",
"build": "turbo build",
"test": "turbo test",
"release": "pnpm build && changeset publish"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/hono-do/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"types": "dist/index.d.ts",
"scripts": {
"lint": "eslint --fix --ext .ts,.tsx src",
"lint:check": "eslint --ext .ts,.tsx src",
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
"format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
"build": "tsc -p tsconfig.build.json",
"test": "vitest"
},
Expand Down
13 changes: 11 additions & 2 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"lint": {},
"format": {}
"lint": {
"dependsOn": ["^build"]
},
"lint:check": {
"dependsOn": ["^build"]
},
"format": {},
"format:check": {},
"test": {
"dependsOn": ["^build"]
}
}
}