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

feat: SKFP-1127 #119

Merged
merged 6 commits into from
Jun 10, 2024
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
5 changes: 4 additions & 1 deletion .env schema
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ KEYCLOAK_REALM=
KEYCLOAK_CLIENT=

# Riff
RIFF_URL=
RIFF_URL=

# Indexs name
ES_BIOSPECIMEN_INDEX=
7 changes: 5 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"simple-import-sort"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
Expand All @@ -29,12 +31,13 @@
"ignoreComments": true
}
],
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-explicit-any": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-console": ["error", { "allow": ["warn", "error", "time", "timeEnd", "assert"] }],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"prefer-spread": "error",
"prettier/prettier": ["error"],
"simple-import-sort/imports": "error"
}
}

26 changes: 26 additions & 0 deletions .github/workflows/check_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check Pull Request Quality

on:
pull_request:
branches: [master]

jobs:
tests:
name: Run Tests
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Use Dependencies Cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
run: npm ci
- name: Run tests and coverage
run: npm run test:coverage
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
FROM node:20-alpine3.18 AS build-image
WORKDIR /app
COPY . .
RUN npm ci
RUN npm run clean
RUN npm run build
RUN npm ci && npm run clean && npm run build && npm run test:silent

# Second image, that creates an image for production
FROM node:20-alpine3.18 AS prod-image
WORKDIR /app
COPY --from=build-image ./app/dist ./dist
COPY package* ./
RUN npm ci --production
CMD [ "node", "./dist/src/index.js" ]
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3 && npm ci --production
ENV NODE_ENV=production
CMD [ "node", "./dist/src/index.js" ]
15 changes: 9 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
},
},
moduleFileExtensions: ['ts', 'js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: 'tsconfig.json',
},
],
},
testMatch: ['**/src/**/*.test.(ts|js)'],
testEnvironment: 'node',
modulePathIgnorePatterns: ['<rootDir>/dist/'],
collectCoverage: true,
collectCoverageFrom: ['src/**/*.ts'],
coverageDirectory: '<rootDir>/coverage/',
};
6 changes: 6 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ignore": ["**/*.test.ts", "**/*.spec.ts", "node_modules"],
"watch": ["src"],
"exec": "npm start",
"ext": "ts"
}
Loading
Loading