Skip to content

Commit

Permalink
(chore): add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
belovetech committed Sep 26, 2023
1 parent d3b5662 commit 253ef6c
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Linting, Building and Testing

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18.17.0' # specify Node.js version here

- name: Install pnpm
run: curl -f https://get.pnpm.io/v6.js | node - add --global pnpm

- name: Install dependencies
run: pnpm install --no-frozen-lockfile

- name: Run lint
run: pnpm run lint # add lint script in package.json


# test_and_build:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout code
# uses: actions/checkout@v2

# - name: Setup Node.js
# uses: actions/setup-node@v2
# with:
# node-version: '18.17.0'

# - name: Install pnpm
# run: curl -f https://get.pnpm.io/v6.js | node - add --global pnpm

# - name: Install dependencies
# run: pnpm install --no-frozen-lockfile

# - name: Run build
# run: pnpm run build

# - name: Run test
# run: pnpm run test
14 changes: 14 additions & 0 deletions movie-service/src/datasource/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,17 @@ if (config.node_env === 'test') {
}

export default database;

// import config from '@config';
// import { PostgresClient, DB } from '@cineverse/libs';
// import { Movie, Theater, ShowTime, Seat } from '@models';

// let database;
// const models = [Movie, Theater, Seat, ShowTime];
// if (config.node_env === 'test') {
// database = new PostgresClient(config.test as DB, models);
// } else {
// database = new PostgresClient(config.development as DB, models);
// }

// export default database;
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"scripts": {
"start": "pnpm -r run dev",
"test:server": "pnpm --parallel run test:server",
"build": "pnpm -r run build",
"clean": "pnpm -r run clean",
"libs": "pnpm --filter @cineverse/libs run dev",
"libs:build": "pnpm --filter @cineverse/libs run build",
Expand All @@ -16,7 +15,10 @@
"auth:test": "pnpm --filter auth-service run test",
"movie": "pnpm --filter movie-service run dev",
"movie:build": "pnpm --filter movie-service run build",
"movie:test": "pnpm --filter movie-service run test"
"movie:test": "pnpm --filter movie-service run test",
"test": "npx nx run-many --target=test --all",
"build": "npx nx run-many --target=build --all",
"lint": "npx nx run-many --target=lint --all"
},
"devDependencies": {
"nx": "^16.7.4"
Expand Down

0 comments on commit 253ef6c

Please sign in to comment.