-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement: add test script to turbo.json + package.json
add install turbo fix: switch from uses to run script use script to install pnpm use pnpm run test in the root directory
- Loading branch information
1 parent
40456f3
commit 6e63bef
Showing
4 changed files
with
89 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,50 @@ | ||
name: Run test pull request | ||
|
||
on: | ||
push: | ||
branches: | ||
- bas | ||
push: | ||
branches: | ||
- bas | ||
|
||
jobs: | ||
test: | ||
name: Course compose CI/CD testing | ||
runs-on: ubuntu-latest | ||
env: | ||
DATABASE_URL: postgresql://postgres:CourseComposeBeta@db.svnqvwyareiofplfxslm.supabase.co:5432/postgres | ||
PRISMA_PROVIDER: go run github.com/steebchen/prisma-client-go | ||
PRISMA_OUTPUT: ../../apps/prisma/db | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install libaries | ||
run: npm install -g pnpm | ||
|
||
- name: Install jest and dependencies with pnpm | ||
working-directory: ./apps/course-api | ||
run: pnpm add --save-dev jest @types/jest ts-jest | ||
|
||
- name: Run course-api integration | ||
working-directory: ./apps/course-api | ||
run: pnpm run integration | ||
|
||
- name: Setup Go 1.21.5 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21.5' | ||
|
||
- name: Generate ORM | ||
working-directory: ./apps/reviews-api | ||
run: go run github.com/steebchen/prisma-client-go generate --schema=../../packages/prisma/schema.prisma | ||
|
||
- name: Run reviews-api unit | ||
working-directory: ./apps/reviews-api | ||
run: pnpm run unit | ||
|
||
- name: Run reviews-api integration | ||
working-directory: ./apps/reviews-api | ||
run: pnpm run integration | ||
|
||
- name: Run api-gateway test | ||
working-directory: ./apps/api-gateway | ||
run: pnpm run test | ||
test: | ||
name: Course compose CI/CD testing | ||
runs-on: ubuntu-latest | ||
env: | ||
DATABASE_URL: postgresql://postgres:CourseComposeBeta@db.svnqvwyareiofplfxslm.supabase.co:5432/postgres | ||
PRISMA_PROVIDER: go run github.com/steebchen/prisma-client-go | ||
PRISMA_OUTPUT: ../../apps/prisma/db | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2.2.2 | ||
with: | ||
version: 8 | ||
run_install: false | ||
|
||
- name: Install turbo | ||
run: pnpm install --global turbo | ||
|
||
- name: Install jest | ||
working-directory: ./apps/course-api | ||
run: pnpm add --save-dev jest @types/jest ts-jest | ||
|
||
- name: Setup Go 1.21.5 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21.5" | ||
|
||
- name: Generate ORM | ||
working-directory: ./apps/reviews-api | ||
run: go run github.com/steebchen/prisma-client-go generate --schema=../../packages/prisma/schema.prisma | ||
|
||
- name: Unit test | ||
run: pnpm run unit | ||
|
||
- name: Integration test | ||
run: pnpm run integration | ||
|
||
- name: Test | ||
run: pnpm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"build": "turbo run build", | ||
"dev": "turbo run dev", | ||
"bootstrap": "docker compose -f docker-compose.dev.yaml down -v && docker compose -f docker-compose.dev.yaml up -d --build --force-recreate", | ||
"lint": "turbo run lint", | ||
"format": "prettier --write \"**/*.{ts,tsx,md,go}\"" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^8.55.0", | ||
"prettier": "^3.1.0", | ||
"tsconfig": "workspace:*", | ||
"turbo": "^1.11.0" | ||
}, | ||
"packageManager": "pnpm@8.9.0", | ||
"name": "course-compose", | ||
"dependencies": { | ||
"@prisma/client": "^5.7.1", | ||
"prettier-plugin-go-template": "^0.0.15" | ||
} | ||
"private": true, | ||
"scripts": { | ||
"build": "turbo run build", | ||
"dev": "turbo run dev", | ||
"bootstrap": "docker compose -f docker-compose.dev.yaml down -v && docker compose -f docker-compose.dev.yaml up -d --build --force-recreate", | ||
"test": "turbo run test", | ||
"unit": "turbo run unit", | ||
"integration": "turbo run integration", | ||
"lint": "turbo run lint", | ||
"format": "prettier --write \"**/*.{ts,tsx,md,go}\"" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^8.55.0", | ||
"prettier": "^3.1.0", | ||
"tsconfig": "workspace:*", | ||
"turbo": "^1.11.0" | ||
}, | ||
"packageManager": "pnpm@8.9.0", | ||
"name": "course-compose", | ||
"dependencies": { | ||
"@prisma/client": "^5.7.1", | ||
"prettier-plugin-go-template": "^0.0.15" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters