From 352af6fbb5e5917848965bbb0491f9ffc97a4f5c Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:50:51 -0400 Subject: [PATCH] Update ms5.yaml --- .github/workflows/ms5.yaml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index bcf6bb3..1e43ac4 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -1,14 +1,16 @@ -name: CI Pipeline - -# This is a trigger for any push to the repo -on: +name: API CI/CD +# This is a trigger for any push to the repo, and tells github when the actions have to be run +# Every time we do a push, the action will be executed +# The actions should be run only when there is a push from main and develop +on: push: branches: - MileStone5eric +#Tells github actions what to execute when trigger condition is met jobs: # Each job runs in parallel - name_your_job_whatever_you_want: + tests: #This is the job name # runs-on indicates which GitHub "Runners" will run this CICD pipeline # For all CSE-2102 repos, just use the following line as is @@ -34,18 +36,20 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint - # Run pylint on your pulled code in the Docker container running the job - - name: Analysing the code with pylint - run: | - pylint $(git ls-files './backend/*.py') + + # Pytest is for unit testing your python code. Use this block as is to # install pytest in the Docker container running the job - name: Install pytest run: | python -m pip install --upgrade pip pip install pytest - + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Run main.py + run: | + python3 Backend/main.py + # Run pytest on your pulled codebase - name: Test with pytest run: | - pytest + Backend/ pytest