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

Setup ci pnpm #436

Merged
merged 5 commits into from
Feb 1, 2025
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
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
Loading