Skip to content

Commit

Permalink
Setup ci pnpm (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
toririm authored Feb 1, 2025
2 parents 4ef0d7a + 90b157e commit f0b9647
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .github/actions/setup-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Setup dependencies

on:
workflow_call

runs:
using: 'composite'
steps:
- uses: pnpm/action-setup@v4
with:
package_json_file: './package.json'
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
- run: pnpm install
shell: bash
33 changes: 33 additions & 0 deletions .github/workflows/common-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: common

on:
pull_request:
paths:
- 'modules/common/**'
- '.github/workflows/common-ci.yml'

defaults:
run:
working-directory: modules/common

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: './.github/actions/setup-deps'
- run: pnpm run typecheck

unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: './.github/actions/setup-deps'
- run: pnpm run test:unit

db-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: './.github/actions/setup-deps'
- run: pnpm run test:db
20 changes: 20 additions & 0 deletions .github/workflows/mobile-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: mobile

on:
pull_request:
paths:
- 'services/mobile/**'
- 'modules/common/**'
- '.github/workflows/mobile-ci.yml'

defaults:
run:
working-directory: services/mobile

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: './.github/actions/setup-deps'
- run: pnpm run typecheck
20 changes: 20 additions & 0 deletions .github/workflows/pos-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: pos

on:
pull_request:
paths:
- 'services/pos/**'
- 'modules/common/**'
- '.github/workflows/common-ci.yml'

defaults:
run:
working-directory: services/pos

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: './.github/actions/setup-deps'
- run: pnpm run typecheck
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
. "$(dirname -- "$0")/_/husky.sh"

pnpm fmt
retval=$?

if [ $retval -ne 0 ]
then
exit 1
fi
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions services/mobile/app/routes/welcome._index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { documentSub, orderConverter } from "@cafeore/common";
import {
isRouteErrorResponse,
useRouteError,
useSearchParams,
} from "@remix-run/react";
import { orderConverter } from "common/firebase-utils/converter";
import { documentSub } from "common/firebase-utils/subscription";
import { useEffect, useRef, useState } from "react";
import useSWRSubscription from "swr/subscription";
import bellSound from "~/assets/bell.mp3";
Expand Down
5 changes: 4 additions & 1 deletion services/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
"typegen": "wrangler types"
},
"dependencies": {
"@cafeore/common": "workspace:*",
"@remix-run/cloudflare": "^2.13.1",
"@remix-run/cloudflare-pages": "^2.13.1",
"@remix-run/react": "^2.13.1",
"clsx": "^2.1.1",
"isbot": "^5.1.17",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"swr": "^2.2.5"
"swr": "^2.2.5",
"tailwind-merge": "^2.5.4"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20241022.0",
Expand Down

0 comments on commit f0b9647

Please sign in to comment.