Skip to content
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
43 changes: 0 additions & 43 deletions .github/workflows/docker-image-accountsvc.yml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/docker-image-expensesvc.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/test-accountsvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test - Account Sevice

on:
push:
branches: [ "main" ]
paths:
- "backend/account_service/**"
- ".github/workflows/**-accountsvc.yml"

pull_request:
branches: [ "main" ]
paths:
- "backend/account_service/**"
- ".github/workflows/**-accountsvc.yml"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Start MongoDB container
run: docker run -d -p 27017:27017 --name test-mongo mongo:6

# Test
- name: Run test for account service
env:
PORT: 3030
NODE_ENV: test
JWT_SECRET_KEY: MySecret
MONGO_URI: mongodb://localhost:27017/spendwise
run: |
cd backend/account_service
npm install
npm test
41 changes: 41 additions & 0 deletions .github/workflows/test-expensesvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test - Expense Sevice

on:
push:
branches: [ "main" ]
paths:
- "backend/expense_service/**"
- ".github/workflows/**-expensesvc.yml"

pull_request:
branches: [ "main" ]
paths:
- "backend/expense_service/**"
- ".github/workflows/**-expensesvc.yml"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Start MongoDB container
run: docker run -d -p 27017:27017 --name test-mongo mongo:6

# Test
- name: Install dependencies for account service
run: |
cd backend/account_service
npm install

- name: Run test for expense service
env:
PORT: 3032
NODE_ENV: test
MONGO_URI: mongodb://localhost:27017/spendwise
run: |
cd backend/expense_service
npm install
npm test

Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
name: Docker Image CI - Frontend Sevice
name: Test - Frontend Sevice

on:
push:
branches: [ "main" ]
paths:
- "frontend/**"
- ".github/workflows/docker-image-frontendsvc.yml"
- ".github/workflows//**-frontendsvc.yml"

pull_request:
branches: [ "main" ]
paths:
- "frontend/**"
- ".github/workflows/**-frontendsvc.yml"

jobs:
build:
Expand All @@ -20,12 +26,12 @@ jobs:
# Test
- name: Install dependencies for account service
run: |
cd account_service
cd backend/account_service
npm install

- name: Install dependencies for expense service
run: |
cd expense_service
cd backend/expense_service
npm install

- name: Run test for frontend service
Expand All @@ -39,16 +45,4 @@ jobs:
run: |
cd frontend
npm install
npm run test:e2e

# Containerization
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
run: |
docker build -t tut888/sit737-frontend-service:autobuild ./frontend
docker push tut888/sit737-frontend-service:autobuild
npm run test:e2e
Loading