Skip to content

Commit

Permalink
Merge pull request #14 from CSE2102-Fall24/main
Browse files Browse the repository at this point in the history
"Added API Contracts"
  • Loading branch information
kek20009 authored Nov 4, 2024
2 parents 1981f42 + ffd361f commit 1cd80ba
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/ms5yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: ms5API Testing

on:
push: #we want only the milstone5
branches: [Milestone-5_feature_branch]
pull_request:
branches: [Milestone-5_feature_branch]

jobs:
api-testing:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flask flask_cors flasgger pylint pytest

# Run pylint
- name: Run pylint
run: |
pylint ./backend/*.py
continue-on-error: false # Set to true to see warnings

#docker image build
- name: Build API Docker Image
run: |
docker build -t api-image -f Dockerfile .

#run docker container
- name: Start API Container
run: |
docker run -d -p 5000:5000 --name api-container api-image

#running main.py
- name: Start API Service
run: |
docker exec api-container python main.py

#test_main.py
- name: Run test_main.py
run: |
docker exec api-container pytest test_main.py --maxfail=1 --disable-warnings

#cut the docker
- name: Stop and Remove API Container
run: |
docker stop api-container
docker rm api-container


Binary file added Docs/API Contracts.pdf
Binary file not shown.
Binary file added Docs/Group 51 - Milestone 2.docx
Binary file not shown.
Binary file added Docs/Group 51 - Milestone 3.docx
Binary file not shown.

0 comments on commit 1cd80ba

Please sign in to comment.