Skip to content

Commit

Permalink
Merge branch 'main' into 221-ユーザーをクリックらそのユーザーの情報をモーダルウィンドウ的なので表示させるます
Browse files Browse the repository at this point in the history
  • Loading branch information
s-xix98 authored May 30, 2023
2 parents fba48a0 + 85cd5f4 commit d625fc8
Show file tree
Hide file tree
Showing 21 changed files with 377 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backend-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:
- name: backend npm install
run: cd backend && npm install
- name: set up prisma
run: cd backend && npx prisma db push --preview-feature && npx prisma generate
run: cd backend && npx prisma db push && npx prisma generate
- name: backend test
run: cd backend && timeout 300 make test
32 changes: 31 additions & 1 deletion .github/workflows/storybook-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,23 @@ on:
pull_request:
workflow_dispatch:

env:
DATABASE_URL: postgresql://test:test@localhost:5432/test?schema=public

jobs:
storybook-test:
timeout-minutes: 5
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test
ports:
- 5432:5432

steps:
- name: checkout git repository
uses: actions/checkout@v3
Expand All @@ -35,12 +48,29 @@ jobs:
path: frontend/node_modules
key: cache-frontend-node-modules-${{ hashFiles('frontend/package-lock.json') }}

- name: playwright version
run: npx playwright -V > playwright-version.txt && cat playwright-version.txt

- name: cache playwright
id: cache-playwright
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: cache-playwright-${{ hashFiles('frontend/package-lock.json') }}
key: cache-playwright-${{ hashFiles('frontend/package-lock.json') }}-${{ hashFiles('playwright-version.txt') }}

- name: cache backend node-modules
id: cache-backend-node-modules
uses: actions/cache@v3
with:
path: backend/node_modules
key: cache-backend-node-modules-${{ hashFiles('backend/package-lock.json') }}

- name: backend npm install
run: cd backend && npm install
- name: set up prisma
run: cd backend && npx prisma db push && npx prisma generate && npx prisma db seed
- name: run backend
run: cd backend && npm run start:dev &

- name: frontend npm install
run: cd frontend && npm install
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.docker_build
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@

# MAKE
# ------------------------------------------------------------------------------------------
DOCKER_FILES := frontend/Dockerfile backend/Dockerfile db/Dockerfile
DOCKER_BUILD_TXT := .docker_build

PHONY := all
all:
docker compose up --build
$(MAKE) local-npm-i
docker compose up

$(DOCKER_BUILD_TXT): $(DOCKER_FILES)
date > $(DOCKER_BUILD_TXT)
docker compose build

PHONY += local-npm-i
local-npm-i:
cd frontend && npm i
cd backend && npm i

PHONY += down
down:
Expand Down Expand Up @@ -46,11 +59,11 @@ lint-fix:

PHONY += sb-test
sb-test:
docker exec -t frontend make sb-test
docker compose run --rm frontend make sb-test

PHONY += sb-update
sb-update:
docker exec -t frontend make sb-update
docker compose run --rm frontend make sb-update

# etc...
# ------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "UNLICENSED",
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" .",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" . && npx prisma format",
"format-ck": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\" .",
"start": "nest start",
"start:dev": "nest start --watch --preserveWatchOutput",
Expand Down
4 changes: 2 additions & 2 deletions frontend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ sb-create-file:

PHONY += sb-test
sb-test:
npm run storybook-test
export STORYBOOK_BACKEND="http://backend:8000" && npm run storybook-test-ci

PHONY += sb-update
sb-update:
rm -rf $(shell find src/ -type d -name '__image_snapshots__')
npm run storybook-update-snapshot
export STORYBOOK_BACKEND="http://backend:8000" && npm run storybook-update-snapshot-ci

# etc...
# ------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions frontend/doc/storybook.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pr : [88 storybook を 使って UI テスト](https://github.com/s-xix98/trc-pr

```shell
npm install --save-dev @storybook/test-runner
npm install --save-dev @storybook/jest
npm install --save-dev jest-image-snapshot
```

Expand Down
Loading

0 comments on commit d625fc8

Please sign in to comment.