Skip to content

Commit

Permalink
upto test
Browse files Browse the repository at this point in the history
  • Loading branch information
SAINIAbhishek committed Sep 12, 2024
1 parent 9e46824 commit 3e5feb3
Showing 1 changed file with 65 additions and 73 deletions.
138 changes: 65 additions & 73 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,90 +62,82 @@ jobs:
run: npm run lint
working-directory: ./frontend

# # Step: Formatting job
# format:
# needs: install-dependencies # Dependencies must be installed before formatting
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3

# - name: Setup Node.js
# uses: setup-node.yml

# # Restore Frontend Node.js Modules cache
# - name: Restore Frontend Node.js Modules Cache
# uses: actions/cache@v3
# with:
# path: frontend/node_modules
# key: ${{ runner.os }}-frontend-node-${{ hashFiles('frontend/package-lock.json') }}
# Step: Formatting job
format:
needs: [frontend, server] # Dependencies must be installed before formatting
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

# # Format the frontend code with Prettier
# - name: Check Frontend Code Formatting with Prettier
# run: npm run prettier
# working-directory: ./frontend
# Restore Frontend Node.js Modules cache
- name: Restore Frontend Node.js Modules Cache
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-frontend-${{ hashFiles('frontend/package-lock.json') }}

# # Step: Security audit for both server and frontend
# security-audit:
# needs: install-dependencies # Run only after tests have passed
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# Format the frontend code with Prettier
- name: Check Frontend Code Formatting with Prettier
run: npm run prettier
working-directory: ./frontend

# - name: Setup Node.js
# uses: ./.github/workflows/setup-node.yml
# Step: Security audit for both server and frontend
security-audit:
needs: [frontend, server] # Run only after tests have passed
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

# # Restore Server Node.js Modules cache
# - name: Restore Server Node.js Modules Cache
# uses: actions/cache@v3
# with:
# path: server/node_modules
# key: ${{ runner.os }}-server-node-${{ hashFiles('server/package-lock.json') }}
# Restore Server Node.js Modules cache
- name: Restore Server Node.js Modules Cache
uses: actions/cache@v3
with:
path: server/node_modules
key: ${{ runner.os }}-server-${{ hashFiles('server/package-lock.json') }}

# # Restore Frontend Node.js Modules cache
# - name: Restore Frontend Node.js Modules Cache
# uses: actions/cache@v3
# with:
# path: frontend/node_modules
# key: ${{ runner.os }}-frontend-node-${{ hashFiles('frontend/package-lock.json') }}
# Restore Frontend Node.js Modules cache
- name: Restore Frontend Node.js Modules Cache
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-frontend-${{ hashFiles('frontend/package-lock.json') }}

# # Run npm audit for server
# - name: Run Server npm audit
# run: npm run audit
# working-directory: ./server
# continue-on-error: true
# Run npm audit for server
- name: Run Server npm audit
run: npm run audit
working-directory: ./server
continue-on-error: true

# # Run npm audit for frontend
# - name: Run Frontend npm audit
# run: npm run audit
# working-directory: ./frontend
# continue-on-error: true
# Run npm audit for frontend
- name: Run Frontend npm audit
run: npm run audit
working-directory: ./frontend
continue-on-error: true

# # Step: Run unit tests
# test:
# needs: [lint, format, security-audit]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# Step: Run unit tests
test:
needs: [lint, format, security-audit]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

# - name: Setup Node.js
# uses: ./.github/workflows/setup-node.yml
# Restore Frontend Node.js Modules cache
- name: Restore Frontend Node.js Modules Cache
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-frontend-${{ hashFiles('frontend/package-lock.json') }}

# # Restore Frontend Node.js Modules cache
# - name: Restore Frontend Node.js Modules Cache
# uses: actions/cache@v3
# with:
# path: frontend/node_modules
# key: ${{ runner.os }}-frontend-node-${{ hashFiles('frontend/package-lock.json') }}
# Run frontend unit tests
- name: Run Frontend Unit Tests
run: npm run test:coverage
working-directory: ./frontend
env:
CI: true # Ensures Vitest runs in Continuous Integration mode

# # Run frontend unit tests
# - name: Run Frontend Unit Tests
# run: npm run test:coverage
# working-directory: ./frontend
# env:
# CI: true # Ensures Vitest runs in Continuous Integration mode

# # Step: Build the project
# build:
Expand Down

0 comments on commit 3e5feb3

Please sign in to comment.