Skip to content

Commit

Permalink
Path CICD errors (#124)
Browse files Browse the repository at this point in the history
* Fix Backend CI checks

* Update backend cicd workflow
  • Loading branch information
evanyan13 authored Nov 12, 2024
1 parent ac068b5 commit e1ee6df
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/backend-ci-workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Backend CI Workflow

on:
on:
pull_request:
branches:
- main
Expand All @@ -22,32 +22,32 @@ jobs:

- name: Install Dependencies for Each Service
run: |
cd backend
for service in auth-service question-service user-service matching-service gateway-service collaboration-service; do
services=("auth-service" "code-execution-service" "collaboration-service" "gateway-service" "matching-service" "question-service" "user-service" "y-websocket-service")
for service in "${services[@]}"; do
echo "Installing dependencies for $service"
cd $service
cd backend/$service
npm install
cd ..
cd ../..
done
# Build Check for Each Service
- name: Build Each Service
run: |
cd backend
for service in auth-service question-service user-service matching-service gateway-service collaboration-service; do
services=("auth-service" "code-execution-service" "collaboration-service" "gateway-service" "matching-service" "question-service" "user-service" "y-websocket-service")
for service in "${services[@]}"; do
echo "Building $service"
cd $service
cd backend/$service
npm run build
cd ..
cd ../..
done
# Lint Check for Each Service
- name: Lint Each Service
run: |
cd backend
for service in auth-service question-service user-service matching-service gateway-service collaboration-service; do
services=("auth-service" "code-execution-service" "collaboration-service" "gateway-service" "matching-service" "question-service" "user-service" "y-websocket-service")
for service in "${services[@]}"; do
echo "Linting $service"
cd $service
cd backend/$service
npm run lint
cd ..
cd ../..
done
5 changes: 2 additions & 3 deletions .github/workflows/docker-build-push-gcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ jobs:
env:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GCP_REGION: ${{ secrets.GCP_REGION }}
SERVICES: ${{ vars.SERVICES }}
run: |
# Convert the comma-separated SERVICES string to an array
IFS=',' read -ra services <<< "$SERVICES"
# Define an array with the names of your services
services=("auth-service" "code-execution-service" "collaboration-service" "gateway-service" "matching-service" "question-service" "user-service" "y-websocket-service")
# Loop over each service, build and push its Docker image
for service in "${services[@]}"; do
Expand Down
1 change: 0 additions & 1 deletion backend/question-service/src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
GetQuestionsDto,
UpdateQuestionDto,
FindQuestionByIdDto,
UpdateQuestionTestCasesDto,
} from './dto';

@Controller()
Expand Down
2 changes: 1 addition & 1 deletion backend/question-service/src/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model, Types } from 'mongoose';
import { Question } from './schema/question.schema';
import { CreateQuestionDto, GetQuestionsResponse, TestCase } from './dto';
import { CreateQuestionDto, GetQuestionsResponse } from './dto';
import { RpcException } from '@nestjs/microservices';
import { QUESTION_CATEGORIES } from './constants/question-categories.constant';

Expand Down

0 comments on commit e1ee6df

Please sign in to comment.