Skip to content

Commit

Permalink
prettier fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AvinashMudunuri committed Jul 11, 2024
1 parent 228b37b commit c13f61e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 27 deletions.
50 changes: 24 additions & 26 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ name: Node.js CI

on:
push:
branches: [ "main" ]
branches: ['main']
pull_request:
branches: [ "main" ]
branches: ['main']

jobs:
build:

runs-on: ubuntu-latest

strategy:
Expand All @@ -20,26 +19,25 @@ jobs:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: echo "MONGODB_URI_TEST=${{ secrets.MONGODB_URI_TEST }}" >> $GITHUB_ENV
- run: echo "REDIS_HOST=${{ secrets.REDIS_HOST }}" >> $GITHUB_ENV
- run: echo "REDIS_PORT=${{ secrets.REDIS_PORT }}" >> $GITHUB_ENV
- run: echo "REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }}" >> $GITHUB_ENV
- run: echo "PORT=${{ secrets.PORT }}" >> $GITHUB_ENV
- run: echo "NODE_ENV=${{ secrets.NODE_ENV }}" >> $GITHUB_ENV
- run: echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> $GITHUB_ENV
- run: npm ci
- run: npm run build --if-present
- name: Run test and coverage
run: npm run test:coverage
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage

- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: echo "MONGODB_URI_TEST=${{ secrets.MONGODB_URI_TEST }}" >> $GITHUB_ENV
- run: echo "REDIS_HOST=${{ secrets.REDIS_HOST }}" >> $GITHUB_ENV
- run: echo "REDIS_PORT=${{ secrets.REDIS_PORT }}" >> $GITHUB_ENV
- run: echo "REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }}" >> $GITHUB_ENV
- run: echo "PORT=${{ secrets.PORT }}" >> $GITHUB_ENV
- run: echo "NODE_ENV=${{ secrets.NODE_ENV }}" >> $GITHUB_ENV
- run: echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> $GITHUB_ENV
- run: npm ci
- run: npm run build --if-present
- name: Run test and coverage
run: npm run test:coverage
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage
7 changes: 6 additions & 1 deletion infrastructure/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ const redisClient = redis.createClient({
const setRedisKey = async (key, data) => {
try {
const envKey = `${config.env}_${key}`;
const result = await redisClient.set(envKey, JSON.stringify(data), 'EX', 3600);
const result = await redisClient.set(
envKey,
JSON.stringify(data),
'EX',
3600
);
if (result === 'OK') {
serverLogger.info(`Redis key ${envKey} added successfully`);
} else {
Expand Down

0 comments on commit c13f61e

Please sign in to comment.