Skip to content

Commit b465a66

Browse files
authored
Merge pull request #98 from CS3219-AY2324S1/test-updated-merge
PeerPrep Project Completion
2 parents 7f18eb0 + a19655c commit b465a66

File tree

297 files changed

+52087
-2322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+52087
-2322
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build And Test Collaboration Service
2+
3+
on:
4+
push:
5+
paths:
6+
- "CollaborationService/**"
7+
- ".github/workflows/build_and_test_master_collaboration_service.yaml"
8+
9+
pull_request:
10+
paths:
11+
- "CollaborationService/**"
12+
- ".github/workflows/build_and_test_master_collaboration_service.yaml"
13+
14+
jobs:
15+
build-and-test-collaboration-service:
16+
runs-on: ubuntu-latest
17+
18+
env:
19+
CONTAINER_NAME: "ay2324s1-course-assessment-g16_collaboration-service_1" # Here _ is being used after file directory and service name vs -
20+
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Docker Environment
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Build Collaboration Service and Collaboration Service Database with Docker Compose
29+
run: docker-compose build --no-cache collaboration-service collaboration-service-database
30+
31+
- name: Run Collaboration Service and Collaboration Service Database with Docker Compose
32+
run: docker-compose up -d collaboration-service collaboration-service-database
33+
34+
# - name: Wait For Startup
35+
# run: sleep 30
36+
37+
- name: List Docker Containers
38+
run: docker ps
39+
40+
- name: Logs [For Checking Status Only]
41+
run: docker-compose logs
42+
43+
- name: Set up Node.js Environment For Running Tests # Due to dependency issue, have separated test for matching service
44+
uses: actions/setup-node@v3
45+
with:
46+
node-version: 18
47+
48+
- name: Install Node Dependencies For Running Tests
49+
run: npm install
50+
working-directory: CollaborationService
51+
52+
- name: Run Test Cases in Collaboration Service
53+
run: npm test
54+
working-directory: CollaborationService
55+
56+
- name: Retrieve and Upload Artifacts
57+
uses: actions/upload-artifact@v3
58+
with:
59+
name: collaboration-service-test-jest-report-artifacts
60+
path: CollaborationService/coverage/**
61+
62+
- name: Shut Down Containers
63+
run: docker-compose down
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build And Test Communication Service
2+
3+
on:
4+
push:
5+
paths:
6+
- "CommunicationService/**"
7+
- ".github/workflows/build_and_test_master_communication_service.yaml"
8+
9+
pull_request:
10+
paths:
11+
- "CommunicationService/**"
12+
- ".github/workflows/build_and_test_master_communication_service.yaml"
13+
14+
jobs:
15+
build-and-test-communication-service:
16+
runs-on: ubuntu-latest
17+
18+
env:
19+
CONTAINER_NAME: "ay2324s1-course-assessment-g16_communication-service_1" # Here _ is being used after file directory and service name vs -
20+
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Docker Environment
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Build Communication Service with Docker Compose
29+
run: docker-compose build --no-cache communication-service
30+
31+
- name: Run Communication Service with Docker Compose
32+
run: docker-compose up -d communication-service
33+
34+
# - name: Wait For Startup
35+
# run: sleep 30
36+
37+
- name: List Docker Containers
38+
run: docker ps
39+
40+
- name: Logs [For Checking Status Only]
41+
run: docker-compose logs
42+
43+
- name: Run Test Cases in Communication Service
44+
run: docker exec $CONTAINER_NAME npm test
45+
46+
- name: Retrieve Artifacts [JEST Test Reports]
47+
run: docker cp $CONTAINER_NAME:/usr/src/app/coverage ./communication-service-test-jest-reports
48+
49+
- name: Upload Artifacts
50+
uses: actions/upload-artifact@v3
51+
with:
52+
name: communication-service-test-jest-report-artifacts
53+
path: ./communication-service-test-jest-reports/*
54+
55+
- name: Shut Down Containers
56+
run: docker-compose down
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build And Test Frontend Client
2+
3+
on:
4+
push:
5+
paths:
6+
- "Frontend/**"
7+
- ".github/workflows/build_and_test_master_frontend_client.yaml"
8+
9+
pull_request:
10+
paths:
11+
- "Frontend/**"
12+
- ".github/workflows/build_and_test_master_frontend_client.yaml"
13+
14+
jobs:
15+
build-and-test-frontend-service:
16+
runs-on: ubuntu-latest
17+
18+
env:
19+
CONTAINER_NAME: "ay2324s1-course-assessment-g16_frontend_1" # Here _ is being used after file directory and service name vs -
20+
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Docker Environment
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Build Frontend Client with Docker Compose
29+
run: docker-compose build --no-cache frontend
30+
31+
- name: Run Frontend Client with Docker Compose
32+
run: docker-compose up -d frontend
33+
34+
# - name: Wait For Startup
35+
# run: sleep 30
36+
37+
- name: List Docker Containers
38+
run: docker ps
39+
40+
- name: Logs [For Checking Status Only]
41+
run: docker-compose logs
42+
43+
# - name: Run Test Cases in Frontend Client
44+
# run: docker exec $CONTAINER_NAME npm test
45+
46+
# - name: Retrieve Artifacts [JEST Test Reports]
47+
# run: docker cp $CONTAINER_NAME:/app/coverage ./frontend-client-test-jest-reports
48+
49+
# - name: Upload Artifacts
50+
# uses: actions/upload-artifact@v3
51+
# with:
52+
# name: frontend-client-test-jest-report-artifacts
53+
# path: ./frontend-client-test-jest-reports/*
54+
55+
- name: Shut Down Containers
56+
run: docker-compose down
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build And Test GPT Service
2+
3+
on:
4+
push:
5+
paths:
6+
- "GptService/**"
7+
- ".github/workflows/build_and_test_master_gpt_service.yaml"
8+
9+
pull_request:
10+
paths:
11+
- "GptService/**"
12+
- ".github/workflows/build_and_test_master_gpt_service.yaml"
13+
14+
jobs:
15+
build-and-test-gpt-service:
16+
runs-on: ubuntu-latest
17+
18+
env:
19+
CONTAINER_NAME: "ay2324s1-course-assessment-g16_gpt-service_1" # Here _ is being used after file directory and service name vs -
20+
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Docker Environment
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Create New Environment File With GPT API Key
29+
run: echo GPT_API_KEY=${{ secrets.GPT_API_KEY }} > GptService/.env
30+
31+
- name: Build GPT Service with Docker Compose
32+
run: docker-compose build --no-cache gpt-service
33+
34+
- name: Run GPT Service with Docker Compose
35+
run: docker-compose up -d gpt-service
36+
37+
# - name: Wait For Startup
38+
# run: sleep 30
39+
40+
- name: List Docker Containers
41+
run: docker ps
42+
43+
- name: Logs [For Checking Status Only]
44+
run: docker-compose logs
45+
46+
- name: Run Test Cases in GPT Service
47+
run: docker exec $CONTAINER_NAME npm test
48+
49+
- name: Retrieve Artifacts [JEST Test Reports]
50+
run: docker cp $CONTAINER_NAME:/usr/src/app/coverage ./gpt-service-test-jest-reports
51+
52+
- name: Upload Artifacts
53+
uses: actions/upload-artifact@v3
54+
with:
55+
name: gpt-service-test-jest-report-artifacts
56+
path: ./gpt-service-test-jest-reports/*
57+
58+
- name: Shut Down Containers
59+
run: docker-compose down
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build And Test History Service
2+
3+
on:
4+
push:
5+
paths:
6+
- "HistoryService/**"
7+
- ".github/workflows/build_and_test_master_history_service.yaml"
8+
9+
pull_request:
10+
paths:
11+
- "HistoryService/**"
12+
- ".github/workflows/build_and_test_master_history_service.yaml"
13+
14+
jobs:
15+
build-and-test-history-service:
16+
runs-on: ubuntu-latest
17+
18+
env:
19+
CONTAINER_NAME: "ay2324s1-course-assessment-g16_history-service_1" # Here _ is being used after file directory and service name vs -
20+
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Docker Environment
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Build History Service and History Service Database with Docker Compose
29+
run: docker-compose build --no-cache history-service history-service-database
30+
31+
- name: Run History Service and History Service Database with Docker Compose
32+
run: docker-compose up -d history-service history-service-database
33+
34+
- name: Wait For Startup of MySQL Container
35+
run: sleep 10
36+
37+
- name: List Docker Containers
38+
run: docker ps
39+
40+
- name: Logs [For Checking Status Only]
41+
run: docker-compose logs
42+
43+
- name: Run Test Cases in History Service
44+
run: docker exec $CONTAINER_NAME npm test
45+
46+
- name: Retrieve Artifacts [JEST Test Reports]
47+
run: docker cp $CONTAINER_NAME:/app/coverage ./history-service-test-jest-reports
48+
49+
- name: Upload Artifacts
50+
uses: actions/upload-artifact@v3
51+
with:
52+
name: history-service-test-jest-report-artifacts
53+
path: ./history-service-test-jest-reports/*
54+
55+
- name: Shut Down Containers
56+
run: docker-compose down
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build And Test Matching Service
2+
3+
on:
4+
push:
5+
paths:
6+
- "MatchingService/**"
7+
- ".github/workflows/build_and_test_master_matching_service.yaml"
8+
9+
pull_request:
10+
paths:
11+
- "MatchingService/**"
12+
- ".github/workflows/build_and_test_master_matching_service.yaml"
13+
14+
jobs:
15+
build-and-test-matching-service:
16+
runs-on: ubuntu-latest
17+
18+
env:
19+
CONTAINER_NAME: "ay2324s1-course-assessment-g16_matching-service_1" # Here _ is being used after file directory and service name vs -
20+
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Docker Environment
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Build Matching Service, Matching Service Database and RabbitMQ with Docker Compose
29+
run: docker-compose build --no-cache matching-service matching-service-database rabbitmq
30+
31+
- name: Run Matching Service, Matching Service Database and RabbitMQ with Docker Compose
32+
run: docker-compose up -d matching-service matching-service-database rabbitmq
33+
34+
- name: List Docker Containers
35+
run: docker ps
36+
37+
- name: Logs [For Checking Status Only]
38+
run: docker-compose logs
39+
40+
- name: Wait For Startup of Containers
41+
run: sleep 5
42+
43+
- name: Set up Node.js Environment For Running Tests # Due to dependency issue, have separated test for matching service
44+
uses: actions/setup-node@v3
45+
with:
46+
node-version: 18
47+
48+
- name: Install Node Dependencies For Running Tests
49+
run: npm install
50+
working-directory: MatchingService
51+
52+
- name: Run Test Cases in Matching Service
53+
run: npm test
54+
working-directory: MatchingService
55+
56+
- name: Retrieve and Upload Artifacts
57+
uses: actions/upload-artifact@v3
58+
with:
59+
name: matching-service-test-jest-report-artifacts
60+
path: MatchingService/coverage/**
61+
62+
- name: Shut Down Containers
63+
run: docker-compose down

0 commit comments

Comments
 (0)