From b6b002eb9eb6e793056c8a3a07b3f62adfb7677c Mon Sep 17 00:00:00 2001 From: Eric O Asante Date: Thu, 31 Oct 2024 18:34:55 -0400 Subject: [PATCH] Update ms5.yaml --- .github/workflows/ms5.yaml | 39 ++++++++------------------------------ 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ms5.yaml b/.github/workflows/ms5.yaml index 4ac0781..9391f05 100644 --- a/.github/workflows/ms5.yaml +++ b/.github/workflows/ms5.yaml @@ -1,16 +1,14 @@ -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: +name: API CI/CD + +# This is a trigger for any push to the repo +on: push: branches: - MileStone5eric -#Tells github actions what to execute when trigger condition is met jobs: # Each job runs in parallel - tests: #This is the job name + name_your_job_whatever_you_want: # runs-on indicates which GitHub "Runners" will run this CICD pipeline # For all CSE-2102 repos, just use the following line as is @@ -32,36 +30,15 @@ jobs: python-version: ${{ matrix.python-version }} # Pylint is a static code analysis tool. Use this block as is to install pylint # in the Docker container running the job - - name: Install pylint - run: | - python -m pip install --upgrade pip - pip install pylint - - + + # 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: Stop Docker - run: | - docker stop $(docker ps -q) - - - name: Remove Docker - run: | - docker rm $(docker ps -a -q) - - - name: Build Docker - run: | - docker build -f Backend/Docker -t doc Backend/ - - - name: Run Docker - run: | - docker run -d -p 5000:5000 doc - + if [ -f ./Backend/requirements.txt ]; then pip install -r ./Backend/requirements.txt; fi # Run pytest on your pulled codebase - name: Test with pytest run: |